CVE-2026-44477: CloudNativePG's metrics exporter allows privilege escalation to PostgreSQL superuser and OS RCE
The CloudNativePG metrics exporter opens its PostgreSQL connection as the postgres superuser via the pod-local Unix socket, then demotes the session with SET ROLE pg_monitor. SET ROLE changes only current_user; session_user remains postgres. That residual superuser identity is the foothold for the rest of the chain.
Any SQL expression evaluated inside the scrape session can invoke RESET ROLE to recover real superuser privileges, then use COPY ... TO PROGRAM to spawn an OS-level subprocess as the postgres user inside the primary pod. The READ ONLY transaction flag does not block this; it gates writes to database state, not external processes.
Two exploitation paths follow from this root cause.
References
- github.com/advisories/GHSA-423p-g724-fr39
- github.com/cloudnative-pg/cloudnative-pg/pull/10576
- github.com/cloudnative-pg/cloudnative-pg/releases/tag/v1.28.3
- github.com/cloudnative-pg/cloudnative-pg/releases/tag/v1.29.1
- github.com/cloudnative-pg/cloudnative-pg/security/advisories/GHSA-423p-g724-fr39
- nvd.nist.gov/vuln/detail/CVE-2026-44477
Code Behaviors & Features
Detect and mitigate CVE-2026-44477 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →