Rusty pearls: Postgres RCE on cloud databases
Where
Breaking Ground
BSides Las Vegas
Duration
19 min
Shows how a trusted Postgres language extension lets a low-privilege user run code on cloud-hosted databases.
Summary
The talk covers CVE-2024-10979, a PostgreSQL flaw found by Varonis Threat Labs researchers while they examined what an administrative user on a managed cloud database could reach. Managed services such as AWS RDS give customers an admin role that is not a true superuser, so the question was whether that boundary could be crossed. The speakers explain how trusted procedural languages are meant to restrict access to the underlying host.
The core issue is that the trusted PL/Perl language let a user change process environment variables through a Perl internal hash, something only untrusted languages should allow. PL/Rust compiles functions by invoking cargo, so the altered variables could redirect the build to a chosen binary and inject shell commands through a wrapper script. The researchers describe how they searched open-source extension code for process-launching calls, and why PostgreSQL's process API kept the changed environment from reaching child processes. A short test on a live RDS instance was heavily constrained, and AWS's incident response team responded quickly.
The takeaways are practical: keep minor versions patched, restrict who can create functions and extensions, and use an allow list for loadable extensions. The speakers also argue that managed database backends deserve responsible community research, and that researchers should coordinate with the provider before testing on production cloud services.
Related talks
Main Stage·41 min
Ron Ben Yizhak
Shows how a symlink flaw in the file upload path of Microsoft's Python in Excel containers led to root, and how Excel's trust prompts were bypassed.
Talks·38 min
Jarno Niemelä
Shows how misconfigured file permissions in Windows software let a low-privileged user escalate to admin rights.
Talks·27 min
Maxime Escourbiac
Shows how a GlobalProtect client flaw chains from network-level redirection to code execution and then SYSTEM privileges.


