Junglewise Threat Intelligence

CVE-2026-78155: StackGres operator privilege escalation via metrics exporter

CVE-2026-78155 · Severity: critical · CVSS 9.9 · Published 2026-08-23

Executive brief

StackGres operator's metrics exporter connects to PostgreSQL databases as a superuser and runs queries that contain unqualified function references. A low-privilege tenant who owns a database can shadow these functions with malicious code in their own schema, causing the superuser session to execute attacker-controlled commands. This allows any database owner to run arbitrary operating system commands within the PostgreSQL pod, compromising all data and enabling lateral movement in the Kubernetes cluster.

Technical details

The vulnerability is a privilege escalation through untrusted search path (CWE-426) in StackGres's metrics exporter. The exporter connects to PostgreSQL using superuser credentials with no role demotion, then executes queries via dblink that contain unqualified catalog references (e.g., `version()`, `pg_class`, `pg_attribute`) without pinning the search_path. A database owner can set a database-level search_path to prioritize their schema and create shadow objects (functions/tables) that match the unqualified names; when the exporter's superuser dblink session runs, it resolves these names to the attacker's objects and executes them with superuser privileges, enabling COPY...TO PROGRAM for OS command execution. No authentication is required beyond database ownership. The vulnerability affects all releases with the default metrics exporter (1.x through 1.18.8 and earlier snapshots); StackGres 1.19.0 patches by using a dedicated non-superuser monitoring role, pinning search_path in queries, and using SECURITY DEFINER helpers.

Affected products

  • OnGres Inc. StackGres 1.x through 1.18.8

Timeline

  • 2026-08-23: disclosed
  • 2026-08-23: patched: Fixed in StackGres 1.19.0

References