CVE-2025-0789
Executive Summary
CVE-2025-0789 is a critical SQL injection vulnerability in ESAFENET CDG V5, specifically in the /doneDetail.jsp endpoint. The flowId parameter is directly concatenated into SQL queries without sanitization, allowing unauthenticated remote attackers to execute arbitrary SQL commands. This can lead to full database compromise, data exfiltration, and potential lateral movement within the network. The vendor has not responded to disclosure, and no patch is available. Public exploit code exists, increasing the risk of active exploitation.
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 in an open-source package (NPM, PyPI, Go, Ruby) but in a proprietary enterprise document management system. The lack of vendor response means no official patch or advisory is available, placing the burden on defenders to implement virtual patching or network-level controls.
CVSS Breakdown & Threat Level
- 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 vulnerable component is the database.
- Confidentiality (C): High (H) – Full database read access.
- Integrity (I): High (H) – Data can be modified or deleted.
- Availability (A): High (H) – Potential for denial of service via SQL injection.
CVSS Score: 9.8 (Critical)
Threat Level: Critical – Immediate action required.
Deep Dive & Mechanics
The vulnerability resides in the doneDetail.jsp page of ESAFENET CDG V5. The flowId parameter is passed directly into a SQL query without proper input validation or parameterized statements. An attacker can inject SQL commands by crafting a malicious flowId value.
Example vulnerable code snippet (conceptual):
String flowId = request.getParameter("flowId");
String query = "SELECT * FROM flow_details WHERE flow_id = '" + flowId + "'";
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(query);
This allows an attacker to break out of the string context and execute arbitrary SQL. For example:
flowId=1' OR '1'='1
This would return all rows from the flow_details table.
The attack is unauthenticated and requires no special privileges. The exploit has been publicly disclosed, making it accessible to threat actors.
Vulnerable vs. Patched Code
Vulnerable Code (Java/JSP):
String flowId = request.getParameter("flowId");
String query = "SELECT * FROM flow_details WHERE flow_id = '" + flowId + "'";
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(query);
Patched Code (using PreparedStatement):
String flowId = request.getParameter("flowId");
String query = "SELECT * FROM flow_details WHERE flow_id = ?";
PreparedStatement pstmt = connection.prepareStatement(query);
pstmt.setString(1, flowId);
ResultSet rs = pstmt.executeQuery();
The patched version uses parameterized queries, which prevent SQL injection by treating user input as data, not executable code.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Target running ESAFENET CDG V5 with
/doneDetail.jspaccessible. - Network connectivity to the target.
Exploit Steps:
- Identify the target URL:
http://<target>/doneDetail.jsp - Inject SQL via the
flowIdparameter:http://<target>/doneDetail.jsp?flowId=1' UNION SELECT null,username,password,null FROM users-- - Use a tool like
sqlmapfor automated exploitation:sqlmap -u "http://<target>/doneDetail.jsp?flowId=1" --batch --dbs
Example Payloads:
- Boolean-based blind:
flowId=1' AND 1=1-- - Time-based blind:
flowId=1' WAITFOR DELAY '0:0:5'-- - Union-based:
flowId=1' UNION SELECT null,@@version,null,null--
Blue Team (Detection & Defense)
Detection:
- Monitor web server logs for suspicious
flowIdparameters containing SQL keywords (UNION,SELECT,OR,AND,--,WAITFOR). - Deploy a Web Application Firewall (WAF) with rules to block SQL injection patterns.
- Use network intrusion detection systems (NIDS) to detect SQL injection attempts.
Defense:
- Implement virtual patching via WAF rules.
- Restrict network access to the CDG application to trusted IPs only.
- Monitor database logs for unusual queries or errors.
- If possible, apply input validation and parameterized queries as a hotfix.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests to
/doneDetail.jspwithflowIdcontaining SQL metacharacters (',--,UNION,SELECT,OR,AND). - Unusual database error messages in HTTP responses (e.g., "You have an error in your SQL syntax").
- Outbound database connections from the web server to unexpected IPs.
File IOCs:
- Modified
doneDetail.jspfile (if attacker uploads a webshell). - Suspicious files in the web root (e.g.,
.jspshells).
Log IOCs:
- Web server logs showing repeated SQL injection attempts.
- Database logs showing queries with
UNION,SELECT, orORin theflowIdcontext.
Detection Engineering
YARA Rule
rule CVE_2025_0789_SQLi_FlowID {
meta:
description = "Detects SQL injection attempts targeting flowId parameter in ESAFENET CDG"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-0789"
strings:
$s1 = "flowId=" nocase
$s2 = "' OR " nocase
$s3 = "' AND " nocase
$s4 = "UNION SELECT" nocase
$s5 = "WAITFOR DELAY" 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-0789 SQL Injection Attempt on ESAFENET CDG
id: 8a4b3c2d-1e5f-6a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects SQL injection attempts against /doneDetail.jsp via flowId parameter
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-0789
logsource:
category: webserver
product: apache
service: http
detection:
selection:
cs-uri-query|contains:
- "flowId=1'"
- "flowId=' OR"
- "flowId=' AND"
- "flowId=1' UNION"
- "flowId=1' WAITFOR"
condition: selection
falsepositives:
- Legitimate use of single quotes in flowId (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-0789 SQL Injection Attempt on ESAFENET CDG"; flow:to_server; content:"/doneDetail.jsp"; http_uri; content:"flowId="; http_uri; pcre:"/flowId=.*['\"]\s*(OR|AND|UNION|WAITFOR)/i"; sid:1000001; rev:1; reference:cve,2025-0789;)
Remediation & Mitigation
Immediate Actions:
- Virtual Patching: Deploy WAF rules to block SQL injection patterns in the
flowIdparameter. - Network Segmentation: Restrict access to the CDG application to trusted IPs only.
- Input Validation: If possible, implement server-side input validation to allow only alphanumeric characters in
flowId.
Long-Term Fix:
- Replace all dynamic SQL queries with parameterized statements (PreparedStatement in Java).
- Conduct a full security audit of the application.
- Contact the vendor for an official patch; if unresponsive, consider migrating to a different solution.
Monitoring:
- Enable detailed logging for web and database servers.
- Set up alerts for SQL injection patterns.
- Regularly review logs for signs of exploitation.
Valters IT