Format string flaw in PostgreSQL pg_basebackup can leak memory
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- High
- Impact type
- —
- Confidentiality · integrity · availability
- Low · None · None
- Fix status
- Partial Red Hat: 1 fixed, 1 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and Red Hat.
Summary
PostgreSQL versions before 18.7, 17.12, 16.16, 15.20 and 14.25 are affected by a flaw where pg_basebackup uses externally controlled backup manifest content as a format string (CWE-134). An attacker who has already compromised a server can make pg_basebackup disclose bytes from its memory. The leaked bytes are not returned to the attacker, so a successful attack would also need separate implementation-specific secrets, and integrity impact is unlikely.
Written with Claude Haiku 5.5 from the sources below · 2026-11-14
Description from the CNA
Use of externally-controlled format string in PostgreSQL pg_basebackup allows an attacker having already compromised a server to achieve disclosure from pg_basebackup memory, via backup manifest bytes. The vulnerability does not return the improperly-read bytes back to the attacker's server, so a successful attack would need separate implementation-specific secrets for that. Integrity impact is unlikely; in particular, the applicable formatter does not support %n. Versions before PostgreSQL 18.7, 17.12, 16.16, 15.20, and 14.25 are affected.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | PostgreSQL | 18 to before 18.7; 17 to before 17.12; 16 to before 16.16; 15 to before 15.20; before 14.25 | 18.7, 17.12, 16.16, 15.20, 14.25 | Patch available | CNA |
- PostgreSQL Vendor— Affected 18 to before 18.7; 17 to before 17.12; 16 to before 16.16; 15 to before 15.20; before 14.25 Fixed in 18.7, 17.12, 16.16, 15.20, 14.25 Patch available CNA
Remediation
Upgrade PostgreSQL to 18.7 on the 18 branch, 17.12 on the 17 branch, 16.16 on the 16 branch, 15.20 on the 15 branch or 14.25 on the 14 branch. Red Hat fixes Red Hat Hardened Images in RHSA-2026:99821.
Written with Claude Haiku 5.5 from the sources below · 2026-11-14
- Fix · CNA PostgreSQL Fixed in 18.7, 17.12, 16.16, 15.20, 14.25
Red Hat 1 advisory
- RHSA-2026:99821 Released 2026-11-12 · Red Hat rating ImportantRed Hat Hardened Images RPMs bug fix and enhancement update
- Red Hat Hardened Images libpq-18.7-0.1.hum1@aarch64, libpq-18.7-0.1.hum1@s390x, libpq-18.7-0.1.hum1@src +4
Fixed in the same release
Records fixed by the same vendor advisory or release, as the CNA lists them.
- Release ·
PostgreSQL 14.25, 15.20 and 3 more versions
40 records Highest priority Priority MEDIUM 27 MEDIUM, 13 LOW
Other records, highest priority first
- TI-2026-90384 Type confusion in PostgreSQL plpgsql allows arbitrary code executionPriority MEDIUM 41
- TI-2026-90383 PostgreSQL domain check use-after-free allows code executionPriority MEDIUM 41
- TI-2026-90382 Heap overflow in PostgreSQL foreign batch inserts allows code executionPriority MEDIUM 41
Vendor assessments
Red Hat
Red Hat rating: Low. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Hardened Images | Affected | No fix yet |
| Red Hat Hardened Images | Fixed | RHSA-2026:99821 |
Timeline
- 2026-11-12 Threatist record created from CVE-2026-16240
- 2026-11-12 Alias added: GHSA-qrq9-3fx6-36f2
- 2026-11-12 Affected versions changed · Red Hat
- 2026-11-12 CVSS score added · Red Hat
- 2026-11-12 CISA SSVC decision points changed
- 2026-11-13 Fix available: RHSA-2026:99821 · Red Hat
- 2026-11-14 Fix available: Red Hat Hardened Images · Red Hat
References
Sources
- CVE-2026-16240 · CVE Program
- CVE-2026-16240 · NVD
- FIRST EPSS
- GHSA-qrq9-3fx6-36f2 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-16240 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences