0 Comments

PostgreSQL shipped a security release on November 12 that quietly closes one of the longest-lived code-execution bugs in the database’s history. Tracked as CVE-2026-6460 (CVSS 8.8), it is a type-confusion flaw that lets a low-privileged user who can create database objects run arbitrary code as the operating system user running the database server. The root cause traces back to a 2004 commit, making this a 22-year-old bug. No active exploitation has been reported yet – but if you run PostgreSQL in a multi-tenant or managed setup, you should patch now rather than wait for it to show up in a scanner.

What the vulnerability is. At its core, CVE-2026-6460 is a type confusion (CWE-843). PostgreSQL tracked typed values inadequately: values were not self-identifying, so a stale value of one type could later be read as if it were a different type. Those stale values could linger in data dictionary entries, PL/pgSQL variables, and elsewhere throughout the engine. Because the flaw lets you confuse one data type for another, it opens the door to memory corruption that can be turned into code execution.

Who found it and how it works. Security researcher Mehmet Ince reported the flaw. The exploit path is subtle, but the shape is simple: you create a composite (row) type and prepare a statement that builds a value of that type with a UUID attribute; then you issue ALTER TYPE to change that attribute to a different type. The prepared statement keeps using the old bytes, which nobody rewrote, but now the server interprets them as the new type. If the new type is bytea, the function that converts it to text treats those bytes as a pointer to an “expanded object” – an in-memory representation PostgreSQL uses for large values – and calls its methods. A null pointer crashes the process; the same confusion applied to an array leaks a memory address. Chain the two together and you can redirect the call and end up running shell commands on the host.

Why 22 years? The ability to change a column’s type arrived in a commit dated May 5, 2004. The expanded-object mechanism that turns the confusion into something exploitable landed in 2015. It took both pieces, plus a careful researcher, to turn a quirky design decision into a real remote-code-execution primitive.

Who is exposed. The vector is network-reachable, low complexity, but requires a login that can create or modify objects (ALTER ... SET DATA TYPE is the primary route; other DDL paths such as ALTER TABLE ... ADD COLUMN; ROLLBACK; ALTER TABLE ... ADD COLUMN exist as well). That gating requirement keeps this off the unauth-authenticated scanner lists, but it makes the flaw a real concern for exactly the deployments that hand out CREATE rights: multi-tenant databases, managed PostgreSQL where customers can define objects, and any application role with schema-creation privileges.

What versions are affected. Every supported release line before the November 2026 update is vulnerable: before 18.7, 17.12, 16.16, 15.20, and 14.25. The November 12 release also patched 51 other security vulnerabilities and more than 140 bugs, so this is a release worth taking seriously across the board. Version 14.25 is the final release for that branch and PostgreSQL 14 is now end of life.

What you need to do right now.

Patch to the fixed versions immediately. Upgrade PostgreSQL to 18.7, 17.12, 16.16, 15.20, or 14.25 depending on your branch. The fix introduces version checks so stored values match their expected types. If you are on unsupported PostgreSQL 13 or older, upgrade to a supported release-line entirely.

Rebuild your C-language extensions. This is the step most people miss. The advisory is explicit: patching the database binaries alone is not enough. Older compiled shared-library extensions still load but may not carry the new type-checking protection, so rebuild any C-language extensions against the updated server to get full coverage.

Audit who can create objects. The bug is only reachable by accounts that can define or alter typed objects. Revoke CREATE on schemas from roles that do not need it, and review every role that has ALTER or object-creation rights on your databases. Least privilege at the schema level closes this attack surface even before a patch.

Watch for it being added to the KEV catalog. CVE-2026-6460 is not there yet, but a strong, low-privilege RCE in software that sits underneath a large share of the internet is an obvious candidate. Treat this as a stop-now patch, not a wait-and-see.

A 22-year-old design flaw that lets a low-privileged database user run code as the operating system account is exactly the kind of bug that ends up weaponized quickly. Patch PostgreSQL, rebuild your C extensions, and tighten CREATE rights – before someone turns this from a proof of concept into the next big incident.

Leave a Reply

Related Posts