PostgreSQL · Public exploit code

Public PoC enables code execution in PostgreSQL via type confusion

· 1 min read

A PoC has been published for CVE-2026-116331, a type confusion flaw in PostgreSQL min/max aggregate optimization. It lets a user with permission to create objects run arbitrary code as the operating system user running the database. Versions before 18.7, 17.12, 16.16, 15.20, and 14.25 are affected; update and restrict object creation.

Illustration: Public PoC enables code execution in PostgreSQL via type confusion
WhatsApp LinkedIn X
HighVulnerabilityPublic exploit codePatched
In this article
  1. What happened
  2. Why it matters
  3. What to do
  4. For the technical team
  5. Timeline
  6. Sources

What happened

A proof of concept has been published for CVE-2026-116331, a flaw in the PostgreSQL database. A user with permission to create objects in the database can run arbitrary code as the operating system user running the database.

Incidents like this, every morning

The ones that need action first, in a 3-minute read.

Free · 1 email a day, in the morning · no spam, unsubscribe in 1 click

Why it matters

The flaw depends on internal permission to create objects, not on internet exposure. If exploited, it runs code on the database server, putting all stored data and the server itself at risk.

What to do

Update PostgreSQL to 18.7, 17.12, 16.16, 15.20, or 14.25. Until then, restrict who can create objects in the database and review those permissions.

For the technical team

CVE
CVE-2026-116331
Affected
PostgreSQL · PostgreSQL before 18.7, 17.12, 16.16, 15.20, and 14.25.
Exploitation
PoC/exploit published, reported by @ptdbugs (dbugs, PT ID PT-2026-145821). No in-the-wild exploitation reported in the sources.
Fix
Update to PostgreSQL 18.7, 17.12, 16.16, 15.20, or 14.25; earlier versions are listed as affected. Mitigation: restrict object creation to trusted users, since the flaw requires that permission.
Vector
PostgreSQL planner, in min/max aggregate optimization. Type confusion: a user-defined aggregate with the SORTOP option makes the planner treat the aggregate's input and result as the same type when they differ. Exploitation requires a user with permission to create objects in the database.
More details
Executed code runs as the operating system user running the database. The @ptdbugs tweet lists the vendor as n/a and points to the full writeup on dbugs.

Timeline

  1. Public PoC disclosed for CVE-2026-116331 in PostgreSQL.

Sources 1 source

Get the next one tomorrow morning

One email a day with what changed, what to fix first and how.

Free · 1 email a day, in the morning · no spam, unsubscribe in 1 click

Share it with your team

Whoever handles security with you should get it too.

LinkedIn X

Your colleague gets a confirmation request. Nothing is sent unless they confirm.

See all news

Read also

Before you go: get this every day

The HIFY Radar daily edition lands every morning with the incidents that need action. Free.

Free · 1 email a day, in the morning · no spam, unsubscribe in 1 click