CVE-2026-6460: Composite type handling after ALTER ... SET DATA TYPE (stale typed values)
PostgreSQL did not track the type of captured composite values, so after a row type changes (ALTER TABLE ... SET DATA TYPE, ALTER TYPE ... ALTER ATTRIBUTE, or ADD COLUMN plus ROLLBACK) stale values are read with the new layout. An object creator can turn the type confusion into arbitrary code execution as the database OS user within a single session, with no race; a proof of concept exists. The fix adds versions to composite types and changes the extension ABI.
Executive Summary & Technical Impact
PostgreSQL did not track the type of captured composite values, so after a row type changes (ALTER TABLE ... SET DATA TYPE, ALTER TYPE ... ALTER ATTRIBUTE, or ADD COLUMN plus ROLLBACK) stale values are read with the new layout. An object creator can turn the type confusion into arbitrary code execution as the database OS user within a single session, with no race; a proof of concept exists. The fix adds versions to composite types and changes the extension ABI.
Tracked under CVE-2026-6460 (CWE-843 (Access of Resource Using Incompatible Type)), this vulnerability affects PostgreSQL 14, 15, 16, 17 and 18 before 14.25, 15.20, 16.16, 17.12 and 18.7 and carries a severity score of 8.8 (HIGH). Engineering and security operations teams running PostgreSQL should prioritize upgrading to PostgreSQL 18.7, 17.12, 16.16, 15.20, 14.25 (C extensions must be rebuilt; some, e.g. pgrx-based, need pgrx 0.19.4+).
Remediation & Patch Guidance
- Upgrade to 18.7 / 17.12 / 16.16 / 15.20 / 14.25 and restart immediately.
- Update or rebuild every C-language extension in the same window; old extensions load but lack the new checks.
- Until patched, restrict CREATE privileges and treat SQL injection as a path to OS-level code execution.
Frequently Asked Questions (CVE-2026-6460)
What versions are affected by CVE-2026-6460?
CVE-2026-6460 affects PostgreSQL 14, 15, 16, 17 and 18 before 14.25, 15.20, 16.16, 17.12 and 18.7 in PostgreSQL (Composite type handling after ALTER ... SET DATA TYPE (stale typed values)).
How do I patch or remediate CVE-2026-6460?
Upgrade affected deployments to PostgreSQL 18.7, 17.12, 16.16, 15.20, 14.25 (C extensions must be rebuilt; some, e.g. pgrx-based, need pgrx 0.19.4+) and verify the remediation steps listed above.
What is the CVSS score of CVE-2026-6460?
CVE-2026-6460 is rated HIGH with a CVSS score of 8.8 (vector: CVSS v3.1 8.8 (vendor). Network, low privileges: any role that can create objects, including temporary objects in pg_temp).
PostgreSQL 18.7 Fixes 52 CVEs, Led by a 22-Year-Old Type Confusion Bug (CVE-2026-6460) That Breaks the Extension ABI
The November minor releases for PostgreSQL 14 through 18 close 52 vulnerabilities, many of them memory-corruption bugs any user who can run SQL can reach. The main fix changes how composite values are stored, so C extensions have to be rebuilt, and some need code changes.
Read full engineering post-mortem (6 min read) →