Security · · 6 min read

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.

Gouache-style illustration of a pale rose wall of square niches, each holding a muted square block, except one niche where a round terracotta disc sits where a square should be
Illustration by TechPulse Editorial · The value in the slot isn't the shape the slot expects.
Severity
HIGH · CVSS 8.8
Affected
PostgreSQL 14, 15, 16, 17 and 18 before 14.25, 15.20, 16.16, 17.12 and 18.7
Patched
PostgreSQL 18.7, 17.12, 16.16, 15.20, 14.25 (released 2026-11-12); 19 RC 2

Minor PostgreSQL releases are usually routine: install the package, restart, done. This one isn’t. On November 12, 2026, the PostgreSQL Global Development Group released 18.7, 17.12, 16.16, 15.20 and 14.25 (plus 19 RC 2), fixing 52 security vulnerabilities and more than 140 other bugs. The headline fix, CVE-2026-6460, changes how the server stores composite values, which breaks the binary interface for C extensions.

Who can exploit what

pganalyze’s Lukas Fittl sorted the 52 CVEs by what an attacker needs. His summary: if anyone other than you can run SQL on the database, including through SQL injection, upgrade now. Any SQL user may be able to work up to the operating-system account or the superuser.

  • No login needed: CVE-2026-116322 (PostgreSQL 18 only). A cancel request sent before login, timed so that authentication_timeout fires during cancel handling, leaks a spinlock and restarts the whole server.
  • Any database user: heap overflows in tsvector functions (CVE-2026-116315, CVE-2026-116317), a use-after-free on anonymous RECORD types in parallel query (CVE-2026-116304), type confusion in set-returning functions such as json_populate_recordset() (CVE-2026-120141) and integer wraparounds (CVE-2026-120139, CVE-2026-116328).
  • Anyone who can create objects, which includes temporary objects in pg_temp that any user can create by default: CVE-2026-6460 and a group of related type-confusion and use-after-free bugs.
  • Users with CREATE on the database: CVE-2026-6467 (CVSS 7.2). Rename a trusted extension’s schema, or target "$user", and CREATE/ALTER EXTENSION runs your SQL as the bootstrap superuser.
  • PL/Perl and PL/Tcl, if installed: several use-after-free and type-confusion bugs (CVE-2026-116307, -116319, -116320, -116309, -116326, -116323). Trusted languages are open to PUBLIC by default.
  • Client tools: pg_dump, pg_restore, reindexdb and vacuumdb get fixes for SQL injection and code execution (for example CVE-2026-116314 and CVE-2026-116318). A malicious dump or a hostile database owner can attack the person running maintenance.

CVE-2026-6460: 22 years of stale row values

The official advisory explains that PostgreSQL “had inadequate tracking of typed values, and values were not self-identifying.” When a row type changes after a query has already captured values of that type, the server reads those old values with the new layout. You can trigger it with ALTER TABLE ... SET DATA TYPE, with ALTER TYPE ... ALTER ATTRIBUTE ... TYPE, or with ALTER TABLE ... ADD COLUMN followed by a rollback and another ADD COLUMN. pganalyze notes that it works within a single session, for example with a prepared statement, with no race needed, and that a proof of concept is available. The flaw dates back about 22 years. The release notes credit several reporters, including Claude and Ada Logics.

Why the fix breaks extensions

Commit 245eb832f adds version tracking to composite types. As Devrim Gündüz, who maintains the PGDG RPM packages, explains, DatumGetHeapTupleHeader() changes from a macro to a server function, and heap_getattr() now calls a new heap_datum_check(). Extensions compile those headers into their own binaries, which causes two problems:

  1. An old extension on a new server still loads and runs, but it doesn’t have the new checks, so it may still be exploitable. That’s why PGDG rebuilt every extension package against the new minors.
  2. Some extensions need code changes, not just a rebuild. pgrx shipped v0.19.4 for the new API, and PostGIS has edge cases with pg_upgrade.

There’s also an ordering problem. If the extension packages are updated while the old server binary is still running (or the reverse), loading a library can fail:

ERROR:  could not load library "/usr/lib/postgresql/18/lib/plpgsql.so":
undefined symbol: heap_datum_update_type

In pganalyze’s tests, PGDG Debian packages handled this cleanly: stop, replace, start. With RPMs, the binaries were replaced before the restart, which leaves a short window where things can break.

What to do

  1. Inventory C extensions on every cluster (SELECT * FROM pg_extension;) and confirm each has a build for the new minor. pgrx-based extensions need pgrx 0.19.4 or later.
  2. Upgrade the server and all extension packages in one maintenance window, then restart immediately. If you use Patroni or custom service units, test this in staging first.
  3. Managed Postgres (RDS, Cloud SQL, Azure, Supabase, Neon and others): check that your provider has rolled out 18.7/17.12/16.16/15.20/14.25, and find out how it handles custom extensions.
  4. Until you’re patched: revoke CREATE on databases from roles that don’t need it, remove plperl/pltcl where nobody uses them, and treat any app with possible SQL injection as a path to OS-level code execution.
  5. Run pg_dump/pg_restore from the new client binaries, especially on dumps you didn’t create yourself.

PostgreSQL 14 is still covered by this release. Teams on 13 or older get none of these fixes.

Sources & Primary Advisories

  1. PostgreSQL — 18.7, 17.12, 16.16, 15.20, 14.25 and 19 RC 2 released
  2. PostgreSQL — CVE-2026-6460 advisory
  3. PostgreSQL — Release 18.7 notes
  4. pganalyze — Postgres 18.7 security release: the impact of CVE-2026-6460
  5. Devrim Gündüz — PGDG packages rebuilt against the new minors
Share Dispatch