CVE-2025-8125
Executive Summary
CVE-2025-8125 is a critical SQL injection vulnerability discovered in the deerwms deer-wms-2 application, affecting versions up to and including 3.3. The vulnerability resides in the /system/role/authUser/allocatedList endpoint, specifically within the params[dataScope] argument. An authenticated attacker can exploit this flaw to inject arbitrary SQL commands, potentially leading to unauthorized data access, data manipulation, or further compromise of the underlying database. The exploit has been publicly disclosed, increasing the risk of active exploitation. The vendor has released a patch, and immediate upgrade is strongly recommended.
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 deer-wms-2 software. The risk is primarily to organizations that have deployed this application internally or as a service.
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 with access to the vulnerable endpoint.
- 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) - Successful exploitation can lead to full database disclosure.
- Integrity Impact: Low (I:L) - Some data modification may be possible.
- Availability Impact: Low (A:L) - The attack could potentially disrupt database availability.
Threat Level: High. The public availability of exploit details and the low complexity of the attack make this a significant threat to unpatched systems.
Deep Dive & Mechanics
The vulnerability is a classic SQL injection flaw in the params[dataScope] parameter of the /system/role/authUser/allocatedList endpoint. The application likely constructs a SQL query by directly concatenating user-supplied input without proper sanitization or parameterization.
Vulnerable Code Snippet (Conceptual):
String query = "SELECT * FROM users WHERE role_id = " + roleId + " AND data_scope = '" + request.getParameter("params[dataScope]") + "'";
An attacker can inject SQL commands by providing a malicious value for params[dataScope], such as:
' OR '1'='1
This would modify the query to:
SELECT * FROM users WHERE role_id = 1 AND data_scope = '' OR '1'='1'
This would return all users, bypassing the intended data scope restriction.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
// Direct concatenation of user input
String dataScope = request.getParameter("params[dataScope]");
String sql = "SELECT * FROM users WHERE role_id = " + roleId + " AND data_scope = '" + dataScope + "'";
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(sql);
Patched Code (Conceptual):
// Use of parameterized queries
String dataScope = request.getParameter("params[dataScope]");
String sql = "SELECT * FROM users WHERE role_id = ? AND data_scope = ?";
PreparedStatement pstmt = connection.prepareStatement(sql);
pstmt.setInt(1, roleId);
pstmt.setString(2, dataScope);
ResultSet rs = pstmt.executeQuery();
The patch replaces string concatenation with a PreparedStatement, which ensures that user input is treated as data, not executable code.
Exploitation & Lab Setup
Red Team (Offensive)
Lab Setup:
- Deploy a vulnerable instance of deerwms-2 (version <= 3.3) in a controlled environment.
- Obtain a valid user account with access to the role management functionality.
Exploitation Steps:
- Authenticate to the application.
- Send a crafted HTTP request to the vulnerable endpoint:
POST /system/role/authUser/allocatedList HTTP/1.1 Host: target.com Content-Type: application/x-www-form-urlencoded Cookie: JSESSIONID=valid_session_id params[dataScope]=' OR '1'='1' -- - Observe that the response returns data for all users, confirming the SQL injection.
- For data extraction, use UNION-based injection:
params[dataScope]=' UNION SELECT null, username, password, null FROM users --
Exploit-DB Code: None available.
Blue Team (Defensive)
Detection:
- Monitor for unusual SQL errors in application logs.
- Look for HTTP requests containing SQL keywords (e.g.,
OR,UNION,SELECT) in theparams[dataScope]parameter. - Use a Web Application Firewall (WAF) to block malicious SQL patterns.
Mitigation:
- Immediately apply the vendor patch.
- If patching is not possible, implement virtual patching via WAF rules.
- Restrict access to the vulnerable endpoint to only authorized users.
- Conduct a thorough review of the application code for similar injection flaws.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP requests to
/system/role/authUser/allocatedListwith suspiciousparams[dataScope]values. - SQL error messages in HTTP responses (e.g., "You have an error in your SQL syntax").
- HTTP requests to
- File IOCs:
- Unexpected entries in application logs containing SQL injection attempts.
- System IOCs:
- Unauthorized database queries or data exports.
- New user accounts or modified permissions.
Detection Engineering
YARA Rule
rule CVE_2025_8125_SQLi_Detection {
meta:
description = "Detects SQL injection attempts targeting CVE-2025-8125 in deerwms"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-8125"
strings:
$s1 = "params[dataScope]" ascii wide nocase
$s2 = "allocatedList" ascii wide nocase
$sqli1 = /' OR '1'='1/ ascii wide nocase
$sqli2 = /UNION SELECT/ ascii wide nocase
$sqli3 = /--/ ascii wide nocase
condition:
all of ($s1, $s2) and any of ($sqli1, $sqli2, $sqli3)
}
Sigma Rule
title: CVE-2025-8125 SQL Injection Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects SQL injection attempts against the deerwms /system/role/authUser/allocatedList endpoint
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-8125
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-uri-query|contains:
- "params[dataScope]"
- "allocatedList"
cs-uri-query|re:
- "'.*OR.*'1'='1"
- "UNION.*SELECT"
- "--"
condition: selection
falsepositives:
- Legitimate use of the parameter with similar patterns (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-8125 SQL Injection Attempt"; flow:to_server,established; content:"/system/role/authUser/allocatedList"; http_uri; content:"params[dataScope]"; http_client_body; pcre:"/(\x27.*OR.*\x271\x27=\x271|UNION.*SELECT|--)/Ri"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Upgrade deerwms-2 to the latest patched version (>= 3.4) provided by the vendor.
- Virtual Patching: If immediate upgrade is not possible, deploy WAF rules to block SQL injection patterns in the
params[dataScope]parameter. - Code Review: Conduct a thorough security audit of the application to identify and fix similar injection vulnerabilities.
- Access Control: Restrict access to the vulnerable endpoint to only necessary users and roles.
- Monitoring: Enable detailed logging and monitoring for the vulnerable endpoint to detect and respond to exploitation attempts.
- Database Hardening: Apply the principle of least privilege to database accounts used by the application.
Report generated by Valters IT DevSecOps & CTI Expert System