PostgreSQL type confusion in pg_restore_attribute_stats() executes arbitrary code (CVE-2026-16238)
A type confusion vulnerability in PostgreSQL's pg_restore_attribute_stats() function allows an object creator to execute arbitrary code as the operating system user running the database. This occurs due to conflation of range and multirange values. The issue affects PostgreSQL major version 18, specifically versions before 18.6. Versions prior to 18.0 are not affected. A patch is available to address this vulnerability.
AI Analysis
Technical Summary
CVE-2026-16238 is a type confusion vulnerability in PostgreSQL's pg_restore_attribute_stats() function. It arises from conflating range and multirange values, enabling an object creator to execute arbitrary code with the privileges of the OS user running the database. This vulnerability affects PostgreSQL versions starting from 18.0 up to but not including 18.6. Versions before 18.0 are unaffected. The vulnerability has been assigned a high severity rating and a patch is available to remediate the issue.
Potential Impact
Successful exploitation of this vulnerability allows an attacker who can create objects in the database to execute arbitrary code with the operating system privileges of the database user. This could lead to unauthorized code execution and potential compromise of the database server environment.
Mitigation Recommendations
A patch is available for this vulnerability. Users should upgrade PostgreSQL to version 18.6 or later to remediate this issue. No additional mitigation steps are indicated by the vendor advisory.
PostgreSQL type confusion in pg_restore_attribute_stats() executes arbitrary code (CVE-2026-16238)
Description
A type confusion vulnerability in PostgreSQL's pg_restore_attribute_stats() function allows an object creator to execute arbitrary code as the operating system user running the database. This occurs due to conflation of range and multirange values. The issue affects PostgreSQL major version 18, specifically versions before 18.6. Versions prior to 18.0 are not affected. A patch is available to address this vulnerability.
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-16238 is a type confusion vulnerability in PostgreSQL's pg_restore_attribute_stats() function. It arises from conflating range and multirange values, enabling an object creator to execute arbitrary code with the privileges of the OS user running the database. This vulnerability affects PostgreSQL versions starting from 18.0 up to but not including 18.6. Versions before 18.0 are unaffected. The vulnerability has been assigned a high severity rating and a patch is available to remediate the issue.
Potential Impact
Successful exploitation of this vulnerability allows an attacker who can create objects in the database to execute arbitrary code with the operating system privileges of the database user. This could lead to unauthorized code execution and potential compromise of the database server environment.
Mitigation Recommendations
A patch is available for this vulnerability. Users should upgrade PostgreSQL to version 18.6 or later to remediate this issue. No additional mitigation steps are indicated by the vendor advisory.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-6q3v-qqc9-g2rv
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-16238"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6a7e0366bf8831d5398f8567
Added to database: 08/13/2026, 17:48:22 UTC
Last enriched: 09/08/2026, 15:14:23 UTC
Last updated: 09/29/2026, 01:47:40 UTC
Views: 57
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.