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.
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
Public PoC disclosed for CVE-2026-116331 in PostgreSQL.
Sources 1 source
- @ptdbugs @ptdbugs



