CVE-2025-8704
Executive Summary
CVE-2025-8704 is a critical SQL injection vulnerability discovered in the Wanzhou WOES Intelligent Optimization Energy Saving System version 1.0. The flaw resides in the Analysis Conclusion Query Module, specifically within the file /WEAS_AlarmResult/GetAlarmResultProcessList. By manipulating the resultId argument, an unauthenticated remote attacker can inject arbitrary SQL commands, potentially leading to unauthorized data access, modification, or system compromise. The exploit has been publicly disclosed, increasing the risk of active exploitation. No official patch is currently available, making immediate mitigation measures essential.
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 related to NPM, PyPI, Go, or Ruby packages. It affects a proprietary industrial control system (ICS) component from Wanzhou. Organizations using this system should treat it as a critical supply chain risk and isolate the affected module until a patch is released.
CVSS Breakdown & Threat Level
- CVSS Score: 6.3 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
- Attack Vector: Network (AV:N) – Exploitable remotely.
- Attack Complexity: Low (AC:L) – No special conditions required.
- Privileges Required: None (PR:N) – No authentication needed.
- User Interaction: None (UI:N) – No user action required.
- Scope: Unchanged (S:U) – Vulnerability cannot affect other components.
- Confidentiality Impact: Low (C:L) – Limited data exposure.
- Integrity Impact: Low (I:L) – Limited data modification.
- Availability Impact: Low (A:L) – Limited service disruption.
Threat Level: High due to public exploit availability and lack of patch. The EPSS score of 0.0% suggests low current exploitation, but this may change rapidly.
Deep Dive & Mechanics
The vulnerability is a classic SQL injection in the resultId parameter of the GetAlarmResultProcessList endpoint. The application fails to sanitize or parameterize user input before constructing SQL queries. An attacker can inject SQL statements by appending malicious payloads to the resultId value.
Example vulnerable request:
GET /WEAS_AlarmResult/GetAlarmResultProcessList?resultId=1' OR '1'='1
This could return all records from the database, bypassing intended access controls. More sophisticated payloads can extract data, modify records, or execute stored procedures.
Root Cause: Lack of input validation and use of dynamic SQL queries. The code likely concatenates user input directly into SQL statements without using prepared statements or parameterized queries.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
string query = "SELECT * FROM AlarmResult WHERE resultId = " + Request.QueryString["resultId"];
SqlCommand cmd = new SqlCommand(query, connection);
Patched Code (Conceptual):
string query = "SELECT * FROM AlarmResult WHERE resultId = @resultId";
SqlCommand cmd = new SqlCommand(query, connection);
cmd.Parameters.AddWithValue("@resultId", Request.QueryString["resultId"]);
The patched version uses parameterized queries, preventing SQL injection. Since no official patch exists, this is a recommended fix for developers.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- Target running WOES Intelligent Optimization Energy Saving System 1.0
- Network access to the
/WEAS_AlarmResult/GetAlarmResultProcessListendpoint
Exploit Steps:
- Identify the vulnerable endpoint:
http://target/WEAS_AlarmResult/GetAlarmResultProcessList?resultId=1 - Test for SQL injection with a simple payload:
If an error is returned, the endpoint is vulnerable.http://target/WEAS_AlarmResult/GetAlarmResultProcessList?resultId=1' - Use UNION-based injection to extract data:
http://target/WEAS_AlarmResult/GetAlarmResultProcessList?resultId=1 UNION SELECT 1,2,3,4,5,6-- - Enumerate database tables and columns using information_schema.
Example SQLMap command:
sqlmap -u "http://target/WEAS_AlarmResult/GetAlarmResultProcessList?resultId=1" --batch --dbs
Blue Team (Defensive)
Detection:
- Monitor HTTP requests to
/WEAS_AlarmResult/GetAlarmResultProcessListfor unusualresultIdvalues. - Look for SQL keywords (SELECT, UNION, OR, AND) in the
resultIdparameter. - Use WAF rules to block suspicious patterns.
Mitigation:
- Immediately isolate the affected system if possible.
- Implement input validation and parameterized queries.
- Apply virtual patching via WAF until an official patch is released.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests to
/WEAS_AlarmResult/GetAlarmResultProcessListwithresultIdcontaining SQL keywords. - Unusual database error messages in HTTP responses.
- Outbound database connections from the web server to unexpected IPs.
- HTTP requests to
File IOCs:
- Modified log files in the application directory.
- Suspicious files in the web root (e.g., webshells).
System IOCs:
- Unauthorized database queries or data exports.
- New user accounts or elevated privileges.
Detection Engineering
YARA Rule
rule CVE_2025_8704_SQLi_Detection {
meta:
description = "Detects SQL injection attempts targeting CVE-2025-8704"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-8704"
strings:
$s1 = "resultId=" nocase
$s2 = "UNION" nocase
$s3 = "SELECT" nocase
$s4 = "OR" nocase
$s5 = "AND" nocase
$s6 = "1=1" nocase
$s7 = "1=2" nocase
condition:
$s1 and (any of ($s2,$s3,$s4,$s5,$s6,$s7))
}
Sigma Rule
title: CVE-2025-8704 SQL Injection Attempt
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects SQL injection attempts against the WOES system
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-uri-query|contains:
- "resultId="
cs-uri-query|contains|all:
- "SELECT"
- "UNION"
condition: selection
falsepositives:
- Legitimate use of SQL keywords in parameters (unlikely)
level: high
Suricata Rule
alert http $EXTERNAL_NET any -> $HOME_NET any (
msg:"CVE-2025-8704 SQL Injection Attempt";
flow:to_server,established;
content:"/WEAS_AlarmResult/GetAlarmResultProcessList"; http_uri;
content:"resultId="; http_uri;
pcre:"/(SELECT|UNION|OR|AND|1=1|1=2)/i";
sid:1000001;
rev:1;
reference:cve,2025-8704;
)
Remediation & Mitigation
Immediate Actions:
- Disable the vulnerable endpoint if not essential.
- Apply WAF rules to block SQL injection patterns.
- Monitor logs for exploitation attempts.
Long-term Fix:
- Contact Wanzhou for an official patch.
- Implement parameterized queries in the application code.
- Conduct a full security audit of the system.
Compensating Controls:
- Network segmentation to limit exposure.
- Database access controls and least privilege.
- Regular vulnerability scanning.
Valters IT – Securing your digital frontier.