Advisories for Golang/Github.com/Cloudnative-Pg/Cloudnative-Pg package

2026

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 …