PostgreSQL Patches 52 Flaws, Including a 22-Year-Old Type Confusion Bug That Enables Authenticated RCE

PostgreSQL Patches 52 Flaws, Including a 22-Year-Old Type Confusion Bug That Enables Authenticated RCE

The PostgreSQL Global Development Group has released updates that fix 52 security flaws, and the headline item is CVE-2026-6460, a type confusion bug with a CVSS score of 8.8. The flaw lets a database user who is able to create objects run code on the server, and any code executed this way inherits the rights of the operating system user that runs PostgreSQL. All versions before 18.7, 17.12, 16.16, 15.20, and 14.25 are affected. So far there is no sign of real-world abuse: the project has not reported any attacks using the flaw, and CISA's assessment in the CVE record lists exploitation as none.

The bug lives in composite types, which are types built from named fields that each carry their own data type. A field's type can be changed while older values of that type are still held in other parts of the server, and the server could then read an old value as if it already had the new type. The fix, described in the project's release notes, adds version checks so the server can detect a value that no longer matches its type. Security researcher Mehmet Ince published a technical writeup this week describing a working exploit demonstrated on PostgreSQL 18.6. His method is to prepare a query that holds a value, change the type of one of the value's fields, and then run the query; the writeup includes SQL that crashes an unpatched server and a second step that leaks memory addresses, though it stops short of the final step that makes the server run a command. Ince traces the root of the flaw to May 5, 2004, when PostgreSQL gained the ability to change a column's type, and his technique for running code relies on a later change made on May 14, 2015. He noted that he could trigger the crash as a lowest-privileged login role, while the project's advisory describes the attacker only as someone who can create objects. Red Hat says an attacker needs a database login with the ability to create or modify objects, and none of the sources state whether an account with only default privileges can go beyond the crash to actually run code.

Ince also adapted the exploit for managed PostgreSQL services and privately shared proofs of concept with their security teams in August. The providers he worked with include AWS (Aurora and RDS), Microsoft (Azure PostgreSQL), Google (AlloyDB), Supabase, Databricks, and Ubicloud, though the writeup does not give each service's current patch status. The project credits more than a dozen reporters for CVE-2026-6460, including Ince, and credits him on five other flaws in the same release. Notably, 32 of the 52 flaws carry a score of 8.8, the highest in the release, and based on the project's vulnerability index only one flaw in the server requires neither a login nor any user action: CVE-2026-116322, which lets an unauthenticated client trigger a restart of PostgreSQL 18 servers. Several other fixes land in client tools, where a crafted archive can make pg_restore run code as the user running it, and a compromised source server can make psql run code through the restore script embedded in pg_dump's tar output.

Administrators should update the server to 18.7, 17.12, 16.16, 15.20, or 14.25 to match their major version, and they should rebuild or update every C-language extension at the same time. Extensions built against older releases still load, but according to a repository notice from the project's RPM package maintainers they may not be protected from the vulnerabilities fixed in this release, and some extensions will also need source-code changes. Extensions rebuilt for the new releases can fail to load on older servers, and extension packages in the project's RPM repositories now require the new minor release. If PostgreSQL runs outside its package's own service unit, for example under Patroni, it should be restarted right after updating. Client tools such as pg_dump, pg_restore, reindexdb, and vacuumdb should be updated on every machine that runs them, and the new composite_type_mismatch setting should not be used to turn off the checks, since the project says doing so carries security risks. There is no workaround for servers that cannot be updated yet, PostgreSQL 14 is now end-of-life with 14.25 as its final release, and administrators should follow the reindexing steps in the release announcement and, if they use incremental backups, take a new full backup and base later incremental backups on it.

Stay secure — stay Wavasec. 🔐