CVE-2025-1843
Executive Summary
CVE-2025-1843 is a critical SQL injection vulnerability in Mini-Tmall, an e-commerce platform, affecting versions up to 20250211. The flaw resides in the select function of com/xq/tmall/dao/ProductMapper.java, where the orderBy argument is unsanitized, allowing remote attackers to inject arbitrary SQL commands. With a CVSS score of 0.0 (placeholder) but a critical classification, the vulnerability is publicly exploited and unpatched. This report provides technical analysis, detection rules, and mitigation strategies.
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
Mini-Tmall is a Java-based application, likely distributed as a WAR or JAR file. No official package manager (NPM, PyPI, Go, Ruby) is involved. The supply chain risk is low, but the lack of vendor response increases reliance on third-party patches or workarounds.
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (placeholder; actual critical severity)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: High (C:H)
- Integrity Impact: High (I:H)
- Availability Impact: High (A:H)
- Threat Level: Critical – Remote, unauthenticated SQL injection with full data compromise.
Deep Dive & Mechanics
The vulnerability is in the MyBatis mapper ProductMapper.java. The select function likely constructs a dynamic SQL query using the orderBy parameter without parameterization or escaping. An attacker can inject SQL via the orderBy argument, e.g., ?orderBy=1; DROP TABLE products;--. This allows data exfiltration, modification, or denial of service.
Root Cause: Lack of input validation and use of string concatenation in SQL queries. The orderBy clause is directly appended to the SQL statement.
Attack Vector: HTTP GET/POST requests to endpoints that call the vulnerable select function, such as product listing or search APIs.
Vulnerable vs. Patched Code
Vulnerable Code (ProductMapper.java):
@Select("SELECT * FROM products ORDER BY ${orderBy}")
List<Product> select(@Param("orderBy") String orderBy);
The ${} syntax in MyBatis allows direct substitution, leading to injection.
Patched Code (Hypothetical):
@Select("SELECT * FROM products ORDER BY #{orderBy}")
List<Product> select(@Param("orderBy") String orderBy);
Using #{} parameterizes the input, preventing injection. Alternatively, whitelist allowed columns.
Exploitation & Lab Setup
Red Team (Exploitation)
Proof of Concept (PoC):
curl -X GET "http://target.com/products?orderBy=1;SELECT+*+FROM+users;--"
Manual Exploit:
-- Extract data via UNION
?orderBy=1 UNION SELECT username,password FROM users--
Automated Exploit (sqlmap):
sqlmap -u "http://target.com/products?orderBy=1" --batch --dbs
Lab Setup:
- Deploy Mini-Tmall (version 20250211) on a local server (e.g., Tomcat).
- Use a vulnerable endpoint like
/products/list?orderBy=id. - Test with the PoC above.
Blue Team (Detection & Defense)
Detection:
- Monitor for SQL injection patterns in
orderByparameter (e.g.,UNION,SELECT,DROP). - Use WAF rules to block suspicious SQL keywords.
Defense:
- Apply input validation: whitelist allowed
orderByvalues (e.g.,id,name,price). - Upgrade to a patched version if available; otherwise, implement a reverse proxy with SQL injection filtering.
Indicators of Compromise (IOCs)
- Network: HTTP requests with
orderBycontaining SQL keywords (e.g.,UNION,SELECT,--). - Logs: Database error logs showing syntax errors from injected queries.
- File: Modified
ProductMapper.javaif attacker gains write access. - Behavior: Unexpected database queries or data exfiltration.
Detection Engineering
YARA Rule
rule CVE_2025_1843_SQLi_OrderBy {
meta:
description = "Detects SQL injection attempts targeting CVE-2025-1843 in Mini-Tmall"
author = "Valters IT"
date = "2025-02-11"
reference = "CVE-2025-1843"
strings:
$orderby = "orderBy" nocase
$sqli1 = "UNION" nocase
$sqli2 = "SELECT" nocase
$sqli3 = "DROP" nocase
$sqli4 = "--" nocase
condition:
$orderby and any of ($sqli*)
}
Sigma Rule
title: CVE-2025-1843 SQL Injection via orderBy Parameter
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects SQL injection attempts in Mini-Tmall orderBy parameter
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
c-uri|contains: "orderBy"
c-uri|contains|any:
- "UNION"
- "SELECT"
- "DROP"
- "--"
condition: selection
falsepositives:
- Legitimate use of SQL keywords in parameter values (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-1843 SQL Injection in Mini-Tmall orderBy"; flow:to_server; content:"orderBy"; http_uri; pcre:"/(UNION|SELECT|DROP|--)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Apply input validation to the
orderByparameter – whitelist allowed values (e.g.,id,name,price). - Short-term: Use a Web Application Firewall (WAF) to block SQL injection patterns.
- Long-term: Replace
${}with#{}in MyBatis mappers or use an ORM with parameterized queries. - Monitoring: Enable detailed logging of database queries and HTTP requests.
- Vendor: Since the vendor is unresponsive, consider forking the project or migrating to an alternative platform.
Valters IT – DevSecOps & Cyber Threat Intelligence