Home / Blog / PostgreSQL RCE: 52 Patches and a 22-Year-Old Bug

PostgreSQL RCE: 52 Patches and a 22-Year-Old Bug

Fifty-two fixes landed in one PostgreSQL release this week, and somewhere in the middle of that list sits a type confusion bug that has been quietly waiting since 2004. CVE-2026-6460 carries a CVSS score of 8.8, needs only a database login that can create objects, and hands the attacker the rights of the operating system user running the postmaster. That is a PostgreSQL RCE in everything but name — and the patch alone is not enough, because every C-language extension on the box has to be rebuilt against the new headers before the fix is complete.

Pixel art of a cracked PostgreSQL database cylinder illustrating the CVE-2026-6460 type confusion RCE
Composite types, stale values, and a 22-year-old assumption.

Twenty-two years of type confusion

Composite types are built from named fields, each with its own data type. A change merged on 5 May 2004 let you alter a column's type; a later change in May 2015 made the exploit path practical. The server can then read a stale value as though it belonged to the new type — a classic type confusion that ends in memory corruption. Mehmet Ince published a working chain against 18.6 this week: a query that crashes an unpatched backend, a second step that leaks memory addresses, and a final step he keeps to himself. He triggered the crash as the lowest-privileged login role.

He also adapted the exploit for managed services and shared proofs of concept privately with AWS (Aurora and RDS), Microsoft, Google (AlloyDB), Supabase, Databricks and Ubicloud in August; none of those providers has published a per-service patch status. Separately, CVE-2026-116322 lets an unauthenticated client restart PostgreSQL 18 servers — no login, no user action required.

The extension rebuild tax

Here is the part that will bite operators: the fix requires rebuilding every C-language extension compiled against the server headers. That is trivial on a box you own and a multi-week project for managed Postgres providers and appliance vendors, who must rebuild, retest and roll out region by region. Until they do, the vulnerable code path stays live. Audit your extension install paths now — pg_available_extensions and the libraries listed in shared_preload_libraries are a good start — and pin a whitelist of what is allowed to load. The same release also patches client-side trouble: a crafted archive can make pg_restore execute code as the invoking user, and a compromised source server can smuggle commands through the restore script in pg_dump's tar output.

Pixel art of C-language PostgreSQL extensions being rebuilt after the CVE-2026-6460 patch
The patch is the easy part; the rebuild is the tax.

Every CREATE grant is an RCE foothold

We have spent years watching botnet operators scan for anything that answers on port 5432, and this bug is exactly what they want: a foothold that survives reboots, sits inside a cloud VPC with generous bandwidth, and rarely trips an alert because it is a database doing database things. An ip stresser panel does not need a fleet of compromised routers when a handful of unpatched Postgres hosts will push a UDP flood or a layer 7 HTTP flood at line rate. From there it is a short hop to a full ddos for hire operation: the database is the persistence, the botnet is the payload.

So treat every role with CREATE rights as a potential PostgreSQL RCE. Revoke CREATE on the public schema, move extension installation behind a change-control gate, and log CREATE TYPE, ALTER TYPE and CREATE EXTENSION the way you log a sudo invocation. If a low-privileged application account can create objects, it can reach the operating system — and from there, our side of the fence.

Pixel art of a low-privileged Postgres role opening a path to a botnet of compromised database hosts
CREATE rights are the new perimeter.

Patch to 18.7, 17.12, 16.16, 15.20 or 14.25, rebuild the extensions, then verify the rebuild actually took. And once the database is clean, remember the rest of the stack is still fair game — which is why we keep a free stress test open at /contact. Point it at your own edge, watch what your ddos protection really absorbs, and find out whether the scrubbing holds before someone runs the same test without asking. Our record board is a reasonable benchmark for what large looks like.