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:
- CVE-2026-116322 (CVSS 5.3, PostgreSQL 18 only): a pre-authentication cancel request can leak a spinlock. It is the only server flaw in this release that needs neither a login nor any user action, and it can be used to force a PostgreSQL 18 server to restart.
- pg_restore: a crafted archive can make pg_restore run code as the user running it.
- psql with pg_dump tar output: a compromised source server can make psql run code through the restore script.
Who Is Affected
- Self-managed PostgreSQL 14, 15, 16, 17 and 18 below the fixed versions, plus all older unsupported releases.
- Multi-tenant platforms, shared hosting, analytics sandboxes and any setup where untrusted or semi-trusted users have accounts that can create tables or types.
- Managed services. Ince says he adapted the exploit for several large cloud database services and shared proofs of concept with their security teams in August. Their current patch status has not been published, so check your provider's notices.
- Administrators and CI pipelines that run
pg_restoreorpsqlon dumps from sources they don't fully trust.
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
- Upgrade every server to the fixed minor release for its major version. Minor upgrades don't need a dump and restore.
- Rebuild or update every C-language extension at the same time. The project warns that extensions built against older releases still load but "may not be protected" from the fixed flaws. RPM extension packages now require the new minor release.
- If PostgreSQL runs outside its package's service unit (for example under Patroni), restart it straight after updating, because the old binary keeps running until you do.
- Update the client tools (
pg_dump,pg_restore,psql,reindexdb,vacuumdb) on every machine that runs them, including backup servers and CI runners. - Don't set
composite_type_mismatchto get around the new version checks. The project says this carries security risks. - Follow the reindexing steps in the release announcement, and if you use incremental backups, take a new full backup and base later incremental backups on it.
- Check who can create objects. Revoke
CREATEon thepublicschema where you can and give each application its own role:
-- 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();
- Plan your way off PostgreSQL 14 and any older major version now. They won't get future fixes.
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.
