Skip to main content
EPSS 0.7%top 49%

PostgreSQL type confusion in cursor CLOSE + DECLARE executes arbitrary code (CVE-2026-16239)

0
High
Published: 08/19/2026 (08/19/2026, 08:52:50 UTC)
Source: GCVE Database
Product: postgresql

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

Postgresqlmore threats →ai
postgresql/postgresql
pkg:deb/postgresql/postgresql
Affected versions
<18.5<17.11<16.15<15.19<14.24

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/14/2026, 01:11:06 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses