CVE-2025-12762

pgAdmin · pgAdmin versions up to Multiple Products

A critical remote code execution (RCE) vulnerability has been identified in pgAdmin, a popular management tool for PostgreSQL.

Executive summary

A critical remote code execution (RCE) vulnerability has been identified in pgAdmin, a popular management tool for PostgreSQL. This flaw allows an attacker to take full control of the server running pgAdmin by tricking the application into restoring a specially crafted database dump file. Successful exploitation could lead to a complete compromise of the server, data theft, and disruption of database services.

Vulnerability

The vulnerability exists within the database restore functionality of pgAdmin when operating in server mode. An authenticated attacker with privileges to perform a restore operation can upload a malicious PLAIN-format dump file. The application fails to properly sanitize the contents of this file, allowing for the injection of arbitrary operating system commands which are then executed with the permissions of the pgAdmin service account on the host server.

Business impact

This vulnerability is rated as critical severity with a CVSS score of 9.1. A successful exploit would grant an attacker complete control over the pgAdmin host server, representing a severe breach of security. The potential consequences include unauthorized access to all managed databases, theft of sensitive data, data modification or deletion, and using the compromised server as a pivot point to attack other systems within the internal network. This poses a direct and critical risk to data confidentiality, integrity, and availability.

Remediation

Immediate Action: Immediately upgrade all instances of pgAdmin to the latest version recommended by the vendor to patch this vulnerability. After patching, carefully review pgAdmin and system logs for any unusual restore activities or suspicious commands that may indicate a prior compromise.

Proactive Monitoring: Monitor pgAdmin application logs for an unusual frequency of restore operations or restores initiated from untrusted sources. On the host server, monitor for unexpected processes or outbound network connections originating from the pgAdmin service account. Implement file integrity monitoring on pgAdmin application directories to detect unauthorized changes.

Compensating Controls: If immediate patching is not feasible, implement the following controls:

  • Restrict network access to the pgAdmin web interface to only trusted administrators and IP addresses.
  • Enforce strict access control policies, ensuring only highly trusted users have permissions to perform database restore operations.
  • Run the pgAdmin service with the least privilege necessary to function, limiting the potential impact of code execution.
  • If possible, temporarily disable the ability to restore from PLAIN-format dump files until a patch can be applied.

Exploitation status

Public Exploit Available: false

Analyst recommendation

Given the critical CVSS score of 9.1 and the direct path to remote code execution, this vulnerability represents a significant and immediate threat to the organization. We strongly recommend that all affected pgAdmin instances are identified and upgraded to a patched version with the highest priority. Although there is no evidence of active exploitation, vulnerabilities of this nature are prime targets for weaponization by threat actors and should be remediated without delay.