CVE-2026-120147

Description

A flaw was found in the PostgreSQL dblink extension. A use-after-free vulnerability allows an authenticated database user with object creation privileges to execute arbitrary code as the operating system user running the database. This flaw is triggered when custom type conversion logic re-enters the dblink extension and closes an active connection while an outer query is still reading its results.

Statement

Red Hat has evaluated this vulnerability as an Important severity risk because an authenticated database user capable of creating database objects can achieve arbitrary code execution under the operating system identity of the PostgreSQL server daemon. While the flaw permits severe host-level compromise, exploitation is bounded by the prerequisite of having existing database access, permissions to declare custom types, and an active installation of the optional dblink extension. In standard Red Hat Enterprise Linux configurations, dblink is not enabled by default.

Mitigation

If the dblink extension is not required by your applications, remove it from all affected databases using the following command in a psql session:

DROP EXTENSION IF EXISTS dblink CASCADE;

If the extension is required, mitigate exposure by preventing untrusted database users from defining custom objects (such as types and functions), for example by revoking create privileges on public schemas:

REVOKE CREATE ON SCHEMA public FROM PUBLIC;

Additionally, revoke execute permissions on dblink functions from untrusted roles.

Caveats: Dropping the extension or revoking schema permissions will break applications and automated tasks that rely on dblink cross-database queries or object creation. These SQL operations take effect immediately and do not require a database service restart or reload.

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.