ZDI-26-974: PostgreSQL pg_stat_statements Extension Heap‑Based Buffer Overflow (CVE‑2026‑14676) Enables Remote Code Execution
What It Is — The Zero Day Initiative advisory ZDI‑26‑974 (also catalogued as ZDI‑CAN‑30576) details a critical heap‑based buffer overflow in PostgreSQL’s pg_stat_statements extension. The flaw resides in the query‑normalization routine, where user‑supplied data is copied into a heap buffer without proper length validation. An attacker who can submit a crafted SQL statement can overflow the buffer, inject arbitrary code, and have that code executed with the privileges of the PostgreSQL service account.
The vulnerability is remote (network‑reachable) but requires authentication; a valid database user is needed to send the malicious query. The CVSS‑3.1 base score is 8.8 (High) with the vector AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H, indicating full confidentiality, integrity, and availability impact.
PostgreSQL released a corrective commit on 13 November 2026 (GitHub commit 1e2795d…) that adds proper bounds checking to the affected code path. The patch is included in the PostgreSQL 15.5 release and back‑ported to supported prior versions.
Affected Products — PostgreSQL (all supported major releases that include the pg_stat_statements extension prior to the 15.5 patch).
Why It Matters for Trust & Control Assurance — The issue tests an organization’s vulnerability‑management control: the ability to discover, assess, and remediate critical flaws before they can be weaponised.
Recommended Actions —
- Patch Immediately – Upgrade PostgreSQL to version 15.5 or later, or apply the back‑ported fix for earlier supported releases.
- Validate Extension Version – Confirm that the
pg_stat_statementsextension version matches the patched code base. - Review Access Controls – Ensure that only trusted accounts have permission to execute arbitrary queries, and consider restricting
pg_stat_statementsusage where not required. - Update Vulnerability Management Processes – Add CVE‑2026‑14676 to your vulnerability‑tracking system, map it to the relevant control objective, and capture remediation evidence for audit purposes.
- Monitor Logs – Enable detailed logging of extension activity and watch for anomalous query patterns that could indicate exploitation attempts.