CVE-2026-116332

Description

A flaw was found in PostgreSQL. This vulnerability allows an authenticated database user with object creation privileges to execute arbitrary code with the permissions of the operating system user running the database service. The issue stems from a use-after-free flaw (accessing memory after it has been released) during portal setup, which occurs when user-defined code executes during query planning or execution startup and closes the portal currently being prepared.

Statement

This vulnerability is rated as Important severity because an authenticated database user with privileges to create objects can execute arbitrary commands on the host operating system under the PostgreSQL service account. On typical Red Hat Enterprise Linux deployments, database instances are restricted to authorized applications and users, limiting immediate exposure. However, in shared or multi-tenant database environments where non-administrative users are granted rights to define custom routines, this flaw allows complete breakout from SQL execution contexts into the underlying host environment. While the prerequisite of having database credentials and object creation permissions reduces widespread automated exposure, the severe consequence of arbitrary code execution justifies an Important rather than Moderate rating.

Mitigation

Restrict network access to trusted management hosts and revoke object creation privileges from non-administrative users:

1. Limit network access to the PostgreSQL service using firewalld to permit only trusted IP addresses:

firewall-cmd --permanent --zone=trusted --add-source=<trusted_ip_or_subnet>
firewall-cmd --permanent --zone=public --remove-port=5432/tcp
firewall-cmd --reload

2. Revoke permissions from untrusted roles to create objects and functions within database schemas:

REVOKE CREATE ON SCHEMA public FROM PUBLIC;

Caveats: Restricting network traffic prevents external clients outside allowlisted subnets from accessing database services. Revoking schema creation privileges prevents non-administrative users from defining custom objects or tables until administrative approval is granted.

Warning: Modifying firewall configurations or reloading firewall rules can disrupt active database network connections.

Common Vulnerability Scoring System (CVSS) Score Details

Info alert:Important note

CVSS scores for open source components depend on vendor-specific factors (e.g. version or build chain). Therefore, Red Hat's score and impact rating can be different from NVD and other vendors. Red Hat remains the authoritative CVE Naming Authority (CNA) source for its products and services (see Red Hat classifications).

The following CVSS metrics and score provided are preliminary and subject to review.

CVSS v3 Score Breakdown

Red HatNVDcve.org
Base Score8.8N/A8.8
Attack VectorNetworkN/ANetwork
Attack ComplexityLowN/ALow
Privileges RequiredLowN/ALow
User InteractionNoneN/ANone
ScopeUnchangedN/AUnchanged
ConfidentialityHighN/AHigh
Integrity ImpactHighN/AHigh
Availability ImpactHighN/AHigh

Vector

Red Hat: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

cve.org: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Understanding the Weakness (CWE)

Confidentiality

Technical Impact: Read Memory

If the expired pointer is used in a read operation, an attacker might be able to control data read in by the application.

Availability

Technical Impact: DoS: Crash, Exit, or Restart

If the expired pointer references a memory location that is not accessible to the product, or points to a location that is "malformed" (such as NULL) or larger than expected by a read or write operation, then a crash may occur.

Integrity,Confidentiality,Availability

Technical Impact: Execute Unauthorized Code or Commands

If the expired pointer is used in a function call, or points to unexpected data in a write operation, then code execution may be possible.

Frequently Asked Questions

Want to get errata notifications? Sign up here.