PostgreSQL CVE-2026-6460 (CVSS 8.8): A 22-Year-Old Type Confusion Bug Lets Database Users Run Code on the Server — 52 Flaws Fixed in 18.7, 17.12, 16.16, 15.20 and 14.25

DevSecOps · 2026-11-15 · By H.A

PostgreSQL CVE-2026-6460 (CVSS 8.8): A 22-Year-Old Type Confusion Bug Lets Database Users Run Code on the Server — 52 Flaws Fixed in 18.7, 17.12, 16.16, 15.20 and 14.25

PostgreSQL's 12 November release fixes 52 security issues, led by CVE-2026-6460, a type confusion bug dating back to 2004 that lets any user who can create objects run code as the postgres OS account, with no workaround available.

PostgreSQL has shipped one of the largest security releases in its history. On 12 November 2026 the project published versions 18.7, 17.12, 16.16, 15.20 and 14.25, fixing 52 security issues across the server and its client tools. The headline flaw, CVE-2026-6460, is a type confusion bug whose roots go back to a feature added in May 2004. A database user who can create objects can use it to run code on the server.

What Happened

The project's security page lists CVE-2026-6460 with a CVSS v3 base score of 8.8 (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H) and the description "Type confusion after ALTER ... SET DATA TYPE executes arbitrary code". It affects every supported major version, 14 through 18. Older major versions that no longer get updates are also vulnerable.

Of the 52 fixes, 32 carry the same 8.8 score, which is the highest rating in this release. Security researcher Mehmet Ince is credited with CVE-2026-6460 and five other flaws. More than a dozen reporters are credited in total.

PostgreSQL 14 reached end of life with this release, so 14.25 is the last update that branch will ever get.

Technical Details

The bug is in how PostgreSQL handles composite types, which are row-like types made up of named fields. When the type of a field is changed with ALTER ... SET DATA TYPE, older values stored in the previous format can still exist elsewhere in the server. PostgreSQL can then read one of those old values as if it had the new type. That kind of type confusion lets an attacker corrupt memory in a controlled way.

The ability to change a column's type arrived on 5 May 2004. The technique that turns the confusion into code execution relies on a change made in May 2015. Ince's public writeup, demonstrated on PostgreSQL 18.6, shows SQL that crashes an unpatched server and a step that leaks memory addresses. It deliberately leaves out the final step that runs a command.

The code runs with the privileges of the operating system account that runs PostgreSQL, usually postgres. From there an attacker can read every database on the cluster, tamper with data, or try to move further into the host.

Other fixes worth noting:

Who Is Affected

There is an open question about the minimum privilege needed. Red Hat says an attacker needs a login that can create or modify objects. It is not yet clear whether an account with only default privileges can get past the crash to code execution.

Patch Status

Fixed versions are 18.7, 17.12, 16.16, 15.20 and 14.25 (19 RC 2 also received the fixes). The project says it knows of no attacks, and CISA lists exploitation as none. There is no workaround for servers that can't be updated yet.

What To Do Now

-- See which roles can create objects in each schema
SELECT n.nspname, r.rolname
FROM pg_namespace n CROSS JOIN pg_roles r
WHERE has_schema_privilege(r.oid, n.oid, 'CREATE')
  AND n.nspname NOT LIKE 'pg_%' AND n.nspname <> 'information_schema';

-- Confirm the running server version after patching
SELECT version();

Why It Matters

A 22-year-old bug in one of the most carefully reviewed open-source databases shows how long subtle memory-safety issues can go unnoticed in mature C code. A bug that needs a login is easy to dismiss, but in many real deployments "an authenticated user who can create a table" includes web application accounts, analysts, tenants and anyone who has phished a developer. With a partial public writeup already available, the gap between "no known attacks" and real-world exploitation could close quickly. Patch the servers, the extensions and the client tools together.

REEF SENTINEL