pgadmin4 has a Meta-Command Filter Command Execution
GHSA-fxmw-jcgr-w44v · CVE-2025-13780 · PYSEC-2026-450
Published · Modified
AI SAST
Find this class of vulnerability in your own code
Corgea's AI-native static analysis detects vulnerabilities like this one across your repositories, ranks them by exploitability, and returns review-ready fixes.
Description
The PLAIN restore meta-command filter introduced in pgAdmin as part of the fix for CVE-2025-12762 does not detect meta-commands when a SQL file begins with a UTF-8 Byte Order Mark (EF BB BF) or other special byte sequences. The implemented filter uses the function has_meta_commands(), which scans raw bytes using a regular expression. The regex does not treat the bytes as ignorable, so meta-commands such as \\! remain undetected. When pgAdmin invokes psql with --file, psql strips the bytes and executes the command. This can result in remote command execution during a restore operation.
References
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2025-13780
- WEB https://github.com/pgadmin-org/pgadmin4/issues/9368
- WEB https://github.com/pgadmin-org/pgadmin4/pull/9426
- WEB https://github.com/pgadmin-org/pgadmin4/commit/1d397395f75320ca1d4ed5e9ca721c603415e836
- WEB https://github.com/pgadmin-org/pgadmin4/commit/d5a909f14cb9713d89b49481ad1929fad89f4576
- PACKAGE https://github.com/pgadmin-org/pgadmin4
- WEB https://github.com/pypa/advisory-database/tree/main/vulns/pgadmin4/PYSEC-2026-450.yaml
- WEB https://pypi.org/project/pgadmin4
Ready to move
Start Securing
Free, no credit card | First findings in minutes