Advisory

GHSA-423p-g724-fr39

Details, part 2 of 2. The advisory

Details

  1. Restrict database ownership. Ensure only fully trusted roles own user databases in scraped clusters. The exploit requires the ability to plant an object on the metrics exporter's search_path in a scraped database, typically by owning the database (and therefore public via pg_database_owner) or by holding CREATE on a schema already reachable through search_path.

*PG <15 caveat:* public grants CREATE to PUBLIC by default before PostgreSQL 15, so any authenticated role in a scraped database can plant a shadow object regardless of ownership.

  1. **Limit the scope of target_databases: '*' queries.** Avoid target_databases: '*' unless every database in the cluster, and every role that owns one, is fully trusted. Where possible, restrict target_databases to specific, known-safe databases.
  1. Do not expose metric query SQL to untrusted users. Multi-tenant platforms that allow customers to supply or influence custom metric query bodies should treat this as a critical trust boundary until the architectural fix is released.

References

  • Fix (Patch 1): PR #10576 "schema-qualify catalog references in default monitoring queries and documentation samples"
  • Fix (Patch 2): "dedicated cnpg_metrics_exporter role with pg_ident.conf peer mapping"
  • Reported by: Mehmet Ince

Sources & licences