CVE-2025-52465
Executive Summary
CVE-2025-52465 is a high-severity vulnerability in GeoServer, an open-source server for sharing and editing geospatial data. An authenticated administrator with access to the security system can exploit the Master Password Dump web page to write the master password in plaintext to an arbitrary file on the server's filesystem. The attacker must provide an absolute path to a non-existent file within existing parent directories. This allows for privilege escalation and persistent access to the GeoServer master password, which can be used to decrypt all other stored credentials. The vulnerability is patched in versions 2.26.4 and 2.27.3.
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)
- Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: High (Administrator)
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High (Master password exposed)
- Integrity Impact: High (Arbitrary file write)
- Availability Impact: None
The threat level is high due to the potential for complete compromise of the GeoServer credential store once the master password is obtained.
Deep Dive & Mechanics
The vulnerability resides in the Master Password Dump web page, which is part of GeoServer's security system. This page is intended to allow administrators to dump the master password for recovery purposes. However, the page does not properly validate the file path provided by the user.
Vulnerable Code Path:
- An authenticated administrator accesses the Master Password Dump page.
- The page prompts for a file path where the master password should be written.
- The application takes the user-supplied path and attempts to create a file at that location.
- The application writes the master password in plaintext to the created file.
- The application does not restrict the path to a safe directory (e.g., a temporary or logs directory).
Exploitation Scenario: An attacker with admin credentials can:
- Log in to the GeoServer web interface.
- Navigate to the Master Password Dump page.
- Provide a path like
/var/www/html/geo.txt(if the web root is writable) or/tmp/geo.txt. - The file is created, and the master password is written to it.
- The attacker can then read the file (e.g., via a web request if written to the web root, or via another vulnerability) and obtain the master password.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
// Vulnerable: No path validation
String filePath = request.getParameter("filePath");
File outputFile = new File(filePath);
// ... write master password to outputFile
Patched Code (Conceptual):
// Patched: Validate path is within allowed directory
String filePath = request.getParameter("filePath");
File outputFile = new File(filePath);
String canonicalPath = outputFile.getCanonicalPath();
String allowedBase = new File("/var/lib/geoserver/security").getCanonicalPath();
if (!canonicalPath.startsWith(allowedBase)) {
throw new SecurityException("Invalid file path");
}
// ... write master password to outputFile
The patch ensures that the file path must be within a designated security directory, preventing arbitrary file writes.
Exploitation & Lab Setup
Red Team
Prerequisites:
- GeoServer instance (version < 2.26.4 or < 2.27.3)
- Valid administrator credentials
Exploitation Steps:
- Log in to GeoServer web interface as an administrator.
- Navigate to the Master Password Dump page (typically at
/web/security/masterPasswordDump). - In the file path field, enter an absolute path to a writable location, e.g.,
/tmp/masterpw.txt. - Submit the form.
- The master password is written to
/tmp/masterpw.txt. - Access the file via another method (e.g., SSH, file inclusion vulnerability, or if written to web root, via HTTP).
Example Request (using curl):
curl -X POST -u admin:password \
-d "filePath=/tmp/masterpw.txt" \
"http://target/geoserver/web/security/masterPasswordDump"
Blue Team
Detection:
- Monitor for access to the Master Password Dump page (
/web/security/masterPasswordDump). - Monitor for file creation events in unusual locations (e.g.,
/tmp,/var/www/html). - Monitor for the creation of files named
masterpw.txtor similar.
Hunting:
- Search logs for POST requests to
/web/security/masterPasswordDump. - Check for unexpected files in web-accessible directories.
- Review GeoServer logs for file write operations.
Prevention:
- Apply the patch immediately.
- Restrict access to the GeoServer web interface to trusted IPs.
- Implement Web Application Firewall (WAF) rules to block requests to the Master Password Dump page from non-admin IPs.
Indicators of Compromise (IOCs)
- File Artifacts: Unexpected files containing the master password, e.g.,
/tmp/masterpw.txt,/var/www/html/geo.txt. - Network Traffic: POST requests to
/geoserver/web/security/masterPasswordDumpwith afilePathparameter. - Log Entries: GeoServer logs showing access to the Master Password Dump page.
- Process: GeoServer process writing to unusual file paths.
Detection Engineering
YARA Rule
rule CVE_2025_52465_GeoServer_MasterPasswordDump {
meta:
description = "Detects attempts to exploit CVE-2025-52465 by writing master password to arbitrary file"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-52465"
strings:
$s1 = "masterPasswordDump" nocase
$s2 = "filePath" nocase
$s3 = "masterpw" nocase
condition:
all of them
}
Sigma Rule
title: GeoServer Master Password Dump Exploitation
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects POST requests to GeoServer Master Password Dump page with filePath parameter
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: POST
cs-uri-stem: '/geoserver/web/security/masterPasswordDump'
cs-uri-query|contains: 'filePath='
condition: selection
falsepositives:
- Legitimate administrative use (should be rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-52465 GeoServer Master Password Dump Exploitation"; flow:to_server,established; content:"POST"; http_method; content:"/geoserver/web/security/masterPasswordDump"; http_uri; content:"filePath="; http_client_body; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade GeoServer to version 2.26.4 or 2.27.3.
- If upgrade is not possible, disable the Master Password Dump page by removing or restricting access to the relevant web component.
- Change the master password immediately after patching.
Long-term Measures:
- Implement strict access controls to the GeoServer web interface.
- Regularly audit administrator accounts and their activities.
- Monitor for unusual file creation events on the server.
- Use a Web Application Firewall (WAF) to block exploitation attempts.
Workaround:
- If the web interface is not required, disable it entirely. The vulnerability only exists in the web interface.
Valters IT
Securing Digital Landscapes