Description

A critical security vulnerability, CVE-2025-13780, has been discovered in pgAdmin, the widely used open-source management tool for PostgreSQL, with CVSS 9.1, this flaw allows remote code execution when pgAdmin runs in server mode, making it a severe threat to database environments. Affected versions are up to 9.10, routine database restore operations from PLAIN-format SQL dump files can be exploited to execute arbitrary commands on the underlying host. This exposes organizations to potential full server compromise, data loss, and lateral movement within their networks, making timely mitigation critical. The root of the issue lies in a mismatch between pgAdmin’s security filter and the psql utility. In an earlier fix for CVE-2025-12762, the pgAdmin team introduced the ‘has_meta_commands’ function to scan SQL dump files and block dangerous meta-commands like ‘\!’ that could trigger shell execution. However, the filter did not account for UTF-8 Byte Order Marks (BOM, EF BB BF) at the start of files. Attackers with malicious dump beginning with a BOM, which the regex-based filter fails to recognize, allowing dangerous commands to pass unchecked. When the file is subsequently processed by psql, the BOM is stripped automatically, and the malicious ‘\!’ command executes, bypassing the filter entirely. Exploitation causes full administrative control of the server, theft or deletion of sensitive database information, and potential spread of attacks across the hosting network. Administrators running pgAdmin in server mode should immediately update to pgAdmin 9.11 or later. In addition, teams should apply any vendor-supplied mitigations, such as restricting restore operations from untrusted sources, enforcing strict access controls, and monitoring for unusual command execution on the server. Awareness of this vulnerability is essential, as it represents a critical bypass of prior security measures and highlights the need for careful handling of text encoding in security filters to prevent code injection attacks.