CVE-2026-120152: PostgreSQL pg_show_all_settings() use-after-free memory disclosure

CVE-2026-120152 · Severity: medium · CVSS 4.3 · Published 2026-11-12

PostgreSQL's pg_show_all_settings() function contains a use-after-free vulnerability that allows an authenticated database user to read arbitrary memory contents. An attacker with database access can exploit this by loading a malicious module while the function scans custom variables, causing information disclosure that could reveal sensitive data stored in server memory.

Technologies: PostgreSQL. Vendors: PostgreSQL.

Quick answers

Is CVE-2026-120152 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-120152 being exploited in the wild.
How severe is CVE-2026-120152?
Medium severity, with a CVSS score of 4.3, published 12 November 2026.
Which products and versions are affected?
PostgreSQL 16.0–16.15, 17.0–17.11, 18.0–18.6.
Is there a fix for CVE-2026-120152?
Yes: fixed in PostgreSQL 18.7, 17.12, 16.16. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-120152 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-120152?
Check whether you run PostgreSQL at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • Fixed in: PostgreSQL 18.7, 17.12, 16.16

Technical details

The vulnerability is a use-after-free flaw in the pg_show_all_settings() function triggered when a module dynamically replaces and frees custom-variable placeholders during scanning. An authenticated attacker with module-loading privileges can craft a module to free memory that pg_show_all_settings() is still traversing, allowing arbitrary memory read access. The vulnerability requires local database authentication but no user interaction beyond connecting to the database.

Affected products

  • PostgreSQL PostgreSQL 16.0–16.15, 17.0–17.11, 18.0–18.6

Timeline

  • 2026-11-12: disclosed

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.