Repository navigation
Conversation
* Added banner stating that schedule maker isn't working * Revert "Added banner stating that schedule maker isn't working" This reverts commit 371d9e6. * Merge pull request #366 from ComputerScienceHouse/fix-ntid-classes Fix ntid classes * I updated the dump process to handle 3 new course fields: Prerequisites, Typically Offered, and Contact Hours. * I added the new column to the CREATE TABLE statement. * Updated the insertOrUpdateCourse code. * Fixed syntax errors. * Changing contact hours to float. * I added a new script, but idk if I should have NOT NULL or not. * I added defaults. * I missed this file... * I was able to get ScheduleMaker to build. * Updated scripts and php. * I fixed a bug with parsing. * Tested and added a bit more to my migration script. * Undo changes on existing migrations. * Added back a space. * I added a new migration script. * Removed space. * I added a script to update the buildings. * Fixed typo. * I found another missing value. * Added more missing buildings. * Updated PAC. * Updated a tiny syntax error from the recent migration. * Updated multi query error handling for php 8.4. * Updated docker version in processDump. --------- Co-authored-by: tmcnulty387 <tmcnulty387@gmail.com> Co-authored-by: Mobmaker <45888585+Mobmaker55@users.noreply.github.com> Co-authored-by: Mary <Ipadlover8322@gmail.com> Co-authored-by: Noah Hanford <bigspaceships56@gmail.com>
| return mysqli_error($this->dbConn); | ||
| $query = "CALL InsertOrUpdateCourse({$quarter}, 0000, '{$departCode}', '{$course}', {$credits}, '{$title}', '{$description}', '{$prerequisites}', '{$typicallyOffered}', {$contactHours})"; | ||
| try { | ||
| mysqli_multi_query($this->dbConn, $query); |
There was a problem hiding this comment.
🔴 High: Code Vulnerability
Detected with AI
Potential SQL injection (...read more)
In PHP, SQL Injection (CWE-89) occurs when user-supplied input is concatenated or interpolated directly into a SQL query string without sanitization. PHP string interpolation ("SELECT * FROM users WHERE id = $id") and concatenation (".") do NOT sanitize — the taint is preserved into the SQL string.
To prevent SQL injection, use PDO or MySQLi prepared statements with bound parameters.
For example, instead of:
$id = $_GET['id'];
$result = $conn->query("SELECT * FROM users WHERE id = $id");Use:
$stmt = $pdo->prepare("SELECT * FROM users WHERE id = ?");
$stmt->execute([$id]);For query builders and ORMs (Doctrine, Eloquent, Laravel Query Builder), prefer their parameter-binding APIs over raw string interpolation.
Helpful? 👍/👎
🚩 Report as false positive. Flags the rule for review to improve detection accuracy.
| if (!mysqli_multi_query($this->dbConn, $query)) { | ||
| return mysqli_error($this->dbConn); | ||
| try { | ||
| mysqli_multi_query($this->dbConn, $query); |
There was a problem hiding this comment.
🔴 High: Code Vulnerability
Detected with AI
Potential SQL injection (...read more)
In PHP, SQL Injection (CWE-89) occurs when user-supplied input is concatenated or interpolated directly into a SQL query string without sanitization. PHP string interpolation ("SELECT * FROM users WHERE id = $id") and concatenation (".") do NOT sanitize — the taint is preserved into the SQL string.
To prevent SQL injection, use PDO or MySQLi prepared statements with bound parameters.
For example, instead of:
$id = $_GET['id'];
$result = $conn->query("SELECT * FROM users WHERE id = $id");Use:
$stmt = $pdo->prepare("SELECT * FROM users WHERE id = ?");
$stmt->execute([$id]);For query builders and ORMs (Doctrine, Eloquent, Laravel Query Builder), prefer their parameter-binding APIs over raw string interpolation.
Helpful? 👍/👎
🚩 Report as false positive. Flags the rule for review to improve detection accuracy.
|
|
||
|
|
||
| FROM docker.io/php:7.3-apache | ||
| FROM docker.io/php:8.4-apache |
There was a problem hiding this comment.
🟡 Low: Healthcheck instruction missing
Containers should expose an explicit `HEALTHCHECK` so runtimes and orchestrators can detect unhealthy applications and automatically restart or replace failing containers. Without a health check, internal failures may go... (...read more)
Containers should expose an explicit HEALTHCHECK so runtimes and orchestrators can detect unhealthy applications and automatically restart or replace failing containers. Without a health check, internal failures may go unnoticed and lead to reduced availability and slower incident recovery.
This rule verifies each Dockerfile build stage (each FROM) and requires a HEALTHCHECK instruction to be present in the stage's instruction set. Stages missing a HEALTHCHECK will be flagged.
Implement the HEALTHCHECK using the CMD form and sensible options (for example, --interval, --timeout, --start-period, --retries) so the probe is lightweight and accurately reflects service health.
Secure example:
FROM alpine:3.14
# application setup...
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD wget -q -O /dev/null http://localhost:8080/health || exit 1Helpful? 👍/👎
🚩 Report as false positive. Flags the rule for review to improve detection accuracy.
| LABEL author="Devin Matte <matted@csh.rit.edu>" | ||
|
|
||
| RUN echo "deb-src http://archive.debian.org/debian buster main" >> /etc/apt/sources.list | ||
| RUN echo "deb-src http://deb.debian.org/debian trixie main" >> /etc/apt/sources.list |
There was a problem hiding this comment.
🟠 Medium: Avoid HTTP
Dockerfile `RUN` commands must not fetch resources over unencrypted HTTP, because clear-text downloads can be intercepted or modified in transit. This increases the risk of supply-chain compromise or execution of malicio... (...read more)
Dockerfile RUN commands must not fetch resources over unencrypted HTTP, because clear-text downloads can be intercepted or modified in transit. This increases the risk of supply-chain compromise or execution of malicious code in the built image.
This rule inspects dockerfile_container resources' RUN entries and flags tokens containing http:// (matches http: but not https:). URLs must use https:// instead of http://. Localhost addresses (http://localhost, http://127.0.0.1, http://[::1]) are excluded from detection.
When switching to HTTPS, also verify artifact integrity (for example, with checksums or signatures) or use trusted TLS-protected registries to further reduce tampering risk.
Secure example using HTTPS and checksum verification:
RUN curl -fsSL https://example.com/artifact.tar.gz -o /tmp/artifact.tar.gz && \
echo "3b7d6f... /tmp/artifact.tar.gz" | sha256sum -c -Helpful? 👍/👎
🚩 Report as false positive. Flags the rule for review to improve detection accuracy.
|
|
||
|
|
||
| FROM docker.io/php:7.3-apache | ||
| FROM docker.io/php:8.4-apache |
There was a problem hiding this comment.
🔴 High: Missing user instruction
Specify a non-root user in the Dockerfile so containers do not run as root by default, which reduces the blast radius of a compromise and prevents easy privilege escalation.
This check inspects every build stage (exclud... (...read more)
Specify a non-root user in the Dockerfile so containers do not run as root by default, which reduces the blast radius of a compromise and prevents easy privilege escalation.
This check inspects every build stage (excluding stages based on scratch) and flags the Dockerfile when no USER instruction appears in any stage. The Dockerfile must include a USER instruction that names a non-root user (username or numeric UID), preferably set in the final stage. Resources missing USER will be flagged.
This rule detects the absence of a USER instruction but does not validate the value—ensure the user is not root or UID 0 and that the user account is created in the image before switching to it.
Secure example:
FROM python:3.11-slim AS builder
# build steps...
FROM python:3.11-slim
RUN groupadd -r app && useradd -r -g app app
COPY --from=builder /app /app
USER app
CMD ["python", "/app/app.py"]Helpful? 👍/👎
🚩 Report as false positive. Flags the rule for review to improve detection accuracy.
|
What
New data
Why
otherwise it borked
Test Plan
dev and locally 10000 times
Env Vars
no
Documentation
no
Checklist