PostgreSQL type confusion in cursor CLOSE + DECLARE executes arbitrary code (CVE-2026-16239)
Type confusion in PostgreSQL "portal"/cursor lifecycle allows a user to execute arbitrary code as the operating system user running the database, via re-creation of a cursor or other portal with different types. Versions before PostgreSQL 18.6, 17.11, 16.15, 15.19, and 14.24 are affected.
AI Analysis
Technical Summary
CVE-2026-16239 is a type confusion vulnerability in PostgreSQL's portal/cursor lifecycle. It enables a user with limited privileges to execute arbitrary code with the operating system privileges of the database process. The issue arises when a cursor or portal is re-created with different data types, leading to type confusion. This vulnerability affects multiple PostgreSQL versions prior to 18.5, 17.11, 16.15, 15.19, and 14.24. The vulnerability is classified under CWE-843 (Type Confusion) and has a CVSS 3.1 score of 8.8, indicating high impact on confidentiality, integrity, and availability.
Potential Impact
Successful exploitation allows an attacker with limited privileges to execute arbitrary code as the operating system user running the PostgreSQL database. This can lead to full compromise of the database server environment, including unauthorized data access, modification, or denial of service.
Mitigation Recommendations
A fix is available in PostgreSQL versions 18.5, 17.11, 16.15, 15.19, and 14.24 and later. Users should upgrade to these or later versions to remediate this vulnerability. No vendor advisory was provided to indicate alternative mitigations or that no action is required.
PostgreSQL type confusion in cursor CLOSE + DECLARE executes arbitrary code (CVE-2026-16239)
Description
Type confusion in PostgreSQL "portal"/cursor lifecycle allows a user to execute arbitrary code as the operating system user running the database, via re-creation of a cursor or other portal with different types. Versions before PostgreSQL 18.6, 17.11, 16.15, 15.19, and 14.24 are affected.
Affected software
pkg:deb/postgresql/postgresqlRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-16239 is a type confusion vulnerability in PostgreSQL's portal/cursor lifecycle. It enables a user with limited privileges to execute arbitrary code with the operating system privileges of the database process. The issue arises when a cursor or portal is re-created with different data types, leading to type confusion. This vulnerability affects multiple PostgreSQL versions prior to 18.5, 17.11, 16.15, 15.19, and 14.24. The vulnerability is classified under CWE-843 (Type Confusion) and has a CVSS 3.1 score of 8.8, indicating high impact on confidentiality, integrity, and availability.
Potential Impact
Successful exploitation allows an attacker with limited privileges to execute arbitrary code as the operating system user running the PostgreSQL database. This can lead to full compromise of the database server environment, including unauthorized data access, modification, or denial of service.
Mitigation Recommendations
A fix is available in PostgreSQL versions 18.5, 17.11, 16.15, 15.19, and 14.24 and later. Users should upgrade to these or later versions to remediate this vulnerability. No vendor advisory was provided to indicate alternative mitigations or that no action is required.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-m6g7-vvh9-445r
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-16239"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6a7e0366bf8831d5398f855f
Added to database: 08/13/2026, 17:48:22 UTC
Last enriched: 08/14/2026, 01:11:06 UTC
Last updated: 09/28/2026, 01:47:41 UTC
Views: 73
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.