CVE-2025-13780
pgAdmin · pgAdmin
A critical remote code execution (RCE) vulnerability has been identified in pgAdmin, a popular database management tool.
Executive summary
A critical remote code execution (RCE) vulnerability has been identified in pgAdmin, a popular database management tool. When pgAdmin is run in server mode, an attacker can exploit this flaw during a database restore process to run malicious commands on the server. This allows for a complete compromise of the host system, posing a severe risk to all managed databases and the underlying network infrastructure.
Vulnerability
This is a command injection vulnerability that can be exploited by a remote attacker. The weakness exists in the database restore functionality when processing PLAIN-format dump files within pgAdmin's server mode. An attacker can craft a malicious dump file containing arbitrary OS commands and upload it. When a user with sufficient privileges initiates a restore from this file via the pgAdmin web interface, the application fails to properly sanitize the input, causing the embedded commands to be executed on the server with the permissions of the pgAdmin service account.
Business impact
This vulnerability is rated as critical severity with a CVSS score of 9.1. Successful exploitation grants an attacker remote code execution on the server hosting pgAdmin, which can lead to a complete system compromise. The potential consequences include theft, modification, or destruction of sensitive data from all managed databases, deployment of ransomware, and using the compromised server as a foothold to launch further attacks against the internal network. This poses a direct threat to data confidentiality, integrity, and availability, and could result in significant financial loss, regulatory penalties, and reputational damage.
Remediation
Immediate Action: Immediately upgrade all vulnerable pgAdmin instances to the latest version provided by the vendor, which contains a patch for this vulnerability. After patching, review system and application logs for any signs of compromise that may have occurred prior to the update, paying close attention to restore operations and unexpected process executions.
Proactive Monitoring:
- Monitor pgAdmin and web server access logs for unusual or frequent database restore attempts, especially from untrusted sources.
- Implement file integrity monitoring on the pgAdmin server to detect unauthorized changes.
- Monitor for suspicious outbound network connections originating from the pgAdmin server process.
- Watch for child processes spawned by the pgAdmin service that are not part of normal operation (e.g.,
sh,bash,powershell,curl,wget).
Compensating Controls: If immediate patching is not feasible, implement the following controls to reduce risk:
- Restrict network access to the pgAdmin web interface to only trusted IP addresses using a firewall.
- Enforce the principle of least privilege by ensuring only highly trusted administrators have permissions to perform database restores.
- If possible, temporarily disable the database restore feature.
- Run pgAdmin in a containerized or sandboxed environment to limit the potential impact of a compromise.
Exploitation status
Public Exploit Available: false
Analyst recommendation
Due to the critical severity (CVSS 9.1) of this remote code execution vulnerability, immediate action is required. All organizations utilizing pgAdmin in server mode must prioritize the deployment of the vendor-supplied patch. The risk of full server compromise and data breach is substantial. Until patching is complete, apply the recommended compensating controls, such as restricting access, to mitigate the immediate threat.