Skip to content
← All stories

Vulnerabilities

PostgreSQL fixes 22-year-old flaw that let users run code on servers

PostgreSQL has patched 52 security flaws, including a bug present since 2004 that let certain users run code on the database server. Updates are available for supported versions, but full protection also requires updating extensions.

Ross Grant3 min read

Laptop installing a security update

The short version

PostgreSQL, a popular database used by many organisations, had a bug that let some users run code on the server. This bug had been present for 22 years. The developers have now fixed it, along with 51 other security issues. To be safe, users need to update both the database and any extra software (extensions) they use with it.

By the numbers

  • 52security flaws patched in the latest PostgreSQL releaseThe Hacker News
  • 8.8CVSS score for the main flaw (CVE-2026-6460)The Hacker News
  • 22 yearslength of time the main bug existed before being fixedThe Hacker News

What happened?

PostgreSQL has patched 52 security flaws, including CVE-2026-6460, a bug present since 2004 that let certain users run code on the database server. The flaw affects all versions before 18.7, 17.12, 16.16, 15.20, and 14.25. Full protection also requires updating or rebuilding C-language extensions. No attacks using the flaw have been reported so far.

How the flaw works

A type confusion bug in PostgreSQL, tracked as CVE-2026-6460, allowed a database user with the right permissions to run code on the server. This flaw existed for 22 years, dating back to a 2004 feature that let users change a column's type. The bug affects all PostgreSQL versions before 18.7, 17.12, 16.16, 15.20, and 14.25, according to The Hacker News (opens in a new tab).

The vulnerability involves composite types, data structures made up of fields with their own data types. If a field's type was changed while old values were still stored, the server could misinterpret the data, leading to a situation where an attacker could crash the server or, with more effort, execute code. The fix adds checks to ensure the server does not read mismatched types.

Who is affected

Any PostgreSQL server running a version older than the patched releases is at risk. The flaw can be exploited by users who can create or modify database objects. Red Hat's assessment says that a database login with these abilities is required, but it is not clear whether default accounts have enough privileges to exploit the bug fully. Managed PostgreSQL services, such as AWS Aurora and RDS, Microsoft Azure PostgreSQL, Google AlloyDB, Supabase, Databricks, and Ubicloud, were notified of the issue in August by the researcher who found the bug. The current patch status of these services is not detailed in the available reporting.

The response

The PostgreSQL Global Development Group released updates that fix this and 51 other security flaws. To be fully protected, administrators must update their server to the latest minor release for their major version. They must also rebuild or update any C-language extensions installed on the server, as extensions built against older versions may remain vulnerable. Some extensions may require source code changes to work with the new protections. The project warns not to disable the new security checks, as this would leave systems exposed.

Client tools such as pg_dump and pg_restore also received security fixes. Administrators should update these tools on every machine where they are used. For those using incremental backups, a new full backup is recommended after updating.

What you should do

  • Update PostgreSQL to 18.7, 17.12, 16.16, 15.20, or 14.25, depending on your current version.
  • Rebuild or update all C-language extensions at the same time as the server update.
  • Update client tools on every machine.
  • Do not turn off the new composite_type_mismatch setting.
  • If using incremental backups, take a new full backup after updating.

There is no workaround for servers that cannot be updated yet. PostgreSQL 14 has reached end-of-life, and older major versions will not receive a fix.

Why it matters

This flaw could let an attacker with a database login and certain permissions take control of the server. Even though there are no reports of attacks so far, the bug was present for over two decades and affects many versions. Updating is essential to prevent future exploits.

Key points

  1. A 22-year-old bug in PostgreSQL let users with certain permissions run code on the server.
  2. 52 security flaws were patched in the latest PostgreSQL updates.
  3. Full protection requires updating both the server and any C-language extensions.
  4. No attacks using this flaw have been reported so far.
  5. Older major versions, including PostgreSQL 14 and below, will not receive a fix.

Sources

  1. The Hacker News

    Reference

The day's cyber news in 5 minutes.

Cyberend Daily is one short email with the stories that matter, written so anyone can follow.

Includes our free beginner roadmap · No spam · Unsubscribe anytime