CVE-2026-137046 — mahmoudai1 school-management-system — CWE-74 · CWE-89
A vulnerability was detected in mahmoudai1 school-management-system up to ecec9faaf2fb1a3c5cd096e063f8ef326d09cdfd. The impacted element is the function userModel::checkUserInDB of the file loginServer.php of the component Login Handler. Performing a manipulation of the argument ID results in sql injection. The attack is possible to be carried out remotely. The exploit is now public and may be used. The project was informed of the problem early through an issue report but has not responded yet.
A vulnerability was detected in mahmoudai1 school-management-system up to ecec9faaf2fb1a3c5cd096e063f8ef326d09cdfd. The impacted element is the function userModel::checkUserInDB of the file loginServer.php of the component Login Handler. Performing a manipulation of the argument ID results in sql injection. The attack is possible to be carried out remotely. The exploit is now public and may be used. The project was informed of the problem early through an issue report but has not responded yet.
🎯 What is this vulnerability?
This vulnerability is a classic SQL Injection (SQLi) flaw classified under CWE-89 (Improper Neutralization of Special Elements used in an SQL Command) and CWE-74 (Improper Neutralization of Special Elements used in an OS Command).
The specific technical failure occurs in the userModel::checkUserInDB function within the loginServer.php file of the mahmoudai1/school-management-system project. The function accepts an argument named ID (likely a user identifier or session token) and fails to sanitize or parameterize this input before incorporating it into a SQL query.
Because the CVSS vector indicates PR:N (No Privileges Required) and AV:N (Network), the vulnerable endpoint is accessible to unauthenticated remote users. The lack of input validation allows an attacker to break out of the intended string context and inject arbitrary SQL commands. This is a direct result of concatenating user-supplied data into SQL statements without using prepared statements or strict type casting.
⚡ Attack Chain
1. Discovery & Reconnaissance
- Fingerprinting: The attacker identifies the target as running
mahmoudai1/school-management-system. This can be done by:
* Checking for default directory structures (e.g., - Version Verification: Since the CVE specifies "up to ecec9faaf2fb1a3c5cd096e063f8ef326d09cdfd," the attacker may attempt to identify the Git commit hash if exposed in source maps, error messages, or version files.
/loginServer.php, /assets/, /vendor/).
* Analyzing HTTP response headers or HTML source code for specific meta tags or script paths unique to this project.
* Using tools like whatweb or nmap with NSE scripts to detect the specific PHP application.
2. Exploitation
The attacker targets theloginServer.php endpoint, specifically the ID parameter. Since the exact URI structure is not explicitly detailed in the CVE description beyond the filename, the following is an illustrative example of how the injection would be constructed based on the described component.Hypothesized Endpoint: POST /loginServer.php or GET /loginServer.php?ID=...
Payload Construction:
The attacker injects a boolean-based blind SQL injection or error-based payload to test for injection.
Example PoC (Illustrative):
# Attempting to trigger a SQL error or boolean response
curl -X POST "http://target-school-system/loginServer.php" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "ID=1' OR '1'='1"If the application is vulnerable, the SQL query might look like this (hypothetical backend code):
// Vulnerable Code Pattern
$query = "SELECT * FROM users WHERE id = '$ID'";With the payload 1' OR '1'='1, the query becomes:
SELECT * FROM users WHERE id = '1' OR '1'='1'This condition is always true, potentially returning the first user in the database or causing an unexpected behavior that confirms the injection.
Advanced Exploitation (Data Exfiltration):
If the application is running on MySQL, the attacker can use UNION SELECT to extract data from other tables (e.g., students, teachers, passwords).
# Example of UNION-based injection (Illustrative)
curl -X POST "http://target-school-system/loginServer.php" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "ID=-1' UNION SELECT username, password FROM users-- -"3. Post-Exploitation
users table. If hashes are weak (MD5/SHA1), they can be cracked offline.FILE privileges, the attacker may attempt to write a webshell to the web root using INTO OUTFILE or LOAD_FILE (if MySQL is configured to allow it).SUPER privileges or if the application allows dynamic SQL execution, the attacker might achieve Remote Code Execution (RCE) by leveraging MySQL UDFs (User-Defined Functions) or other database-specific features.🌍 Real World Impact
UPDATE or DELETE statements.Practical Consequences:
🛡️ Remediation & Mitigation
1. Upgrade/Patch
mahmoudai1/school-management-system up to commit ecec9faaf2fb1a3c5cd096e063f8ef326d09cdfd.userModel::checkUserInDB in loginServer.php to use Prepared Statements with parameterized queries.
* Example Fix (PHP PDO):// Secure Code Pattern
$stmt = $pdo->prepare("SELECT * FROM users WHERE id = :id");
$stmt->execute(['id' => $ID]);
$user = $stmt->fetch();2. Workarounds
ID parameter. Ensure it matches an expected format (e.g., integer only) before processing.if (!ctype_digit($ID)) {
die("Invalid ID format");
}SecRule ARGS:id "@rx (?i)(union|select|insert|update|delete|drop|alter|create|truncate|exec|xp_cmdshell)" \
"id:100001,phase:2,deny,status:403,msg:'SQL Injection Detected'"loginServer.php to specific IP ranges or require additional authentication layers (e.g., CAPTCHA) before the request reaches the vulnerable function.3. Detection
access.log and error.log for suspicious patterns in the ID parameter.GET /loginServer.php?ID=1' OR '1'='1
POST /loginServer.php
ID=-1' UNION SELECT username, password FROM users-- -UNION SELECT statements or queries accessing tables not normally accessed by the login function..php files) that could indicate a webshell upload via SQL injection.⚠️ Urgency
[🤖 CVE Professor AI Security Engine]
FOFA Query