How Regex Bypasses Led to CVE-2025-13780 in pgAdmin
This Endor Labs post explains a critical Remote Code Execution vulnerability (CVE-2025-13780) in pgAdmin 4 caused by relying on a simple regex-based filter to block dangerous meta-commands in uploaded SQL dumps. The built-in check scanned raw bytes looking for backslash-prefixed commands, but attackers crafted payloads with whitespace sequences (like carriage returns or UTF-8 byte order marks) that the regex didn’t catch while the underlying psql tool still treated them as valid meta-commands, enabling arbitrary shell execution during a restore. The researchers walk through how the flawed filter worked, show concrete bypass payloads, and argue that regex is the wrong tool for security-critical input validation. They note that pgAdmin 9.11 mitigates this by using psql’s restricted mode instead of pre-filtering with regex, shifting enforcement into the component that actually runs the script, and recommend upgrading and hardening environments.
https://www.endorlabs.com/learn/when-regex-isnt-enough-how-we-discovered-cve-2025-13780-in-pgadmin
Comments
Post a Comment