CVE-2026-116331: PostgreSQL min/max aggregate type confusion arbitrary code execution

CVE-2026-116331 · Severity: high · CVSS 8.8 · Published 2026-11-12

PostgreSQL is a database management system used to store and retrieve data for applications and organizations. A type confusion vulnerability in the min/max aggregate optimization allows an authenticated database user who can create custom aggregate functions to execute arbitrary code with the privileges of the operating system user running the database server. This could lead to complete compromise of the database and potentially the entire system.

Technologies: PostgreSQL. Vendors: PostgreSQL.

Quick answers

Is CVE-2026-116331 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-116331 being exploited in the wild.
How severe is CVE-2026-116331?
High severity, with a CVSS score of 8.8, published 12 November 2026.
Which products and versions are affected?
PostgreSQL before 14.25, 15.20, 16.16, 17.12, 18.7.
Is there a fix for CVE-2026-116331?
Yes: fixed in PostgreSQL 14.25, 15.20, 16.16, 17.12, 18.7. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-116331 attacked?
It is attacked over the network, in a hosted service.
Am I affected by CVE-2026-116331?
Check whether you run PostgreSQL at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • Fixed in: PostgreSQL 14.25, 15.20, 16.16, 17.12, 18.7

Technical details

A type confusion flaw exists in PostgreSQL's min/max aggregate optimization when processing user-defined aggregates with a SORTOP option. The query planner incorrectly treats the aggregate's input and result types as identical when they actually differ, leading to type confusion that enables arbitrary code execution. The vulnerability requires authenticated database access (CREATE AGGREGATE privilege) and affects PostgreSQL versions before 14.25, 15.20, 16.16, 17.12, and 18.7.

Affected products

  • PostgreSQL PostgreSQL before 14.25, 15.20, 16.16, 17.12, 18.7

Timeline

  • 2026-11-12: disclosed
  • 2026-11-12: patched

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.