CVE-2026-116307

Description

A flaw was found in PostgreSQL. A use-after-free memory flaw in the PL/Perl (plperl) procedural language extension allows an authenticated database user with object creation privileges to execute arbitrary code as the operating system user running the database service. This issue occurs when re-entering the plperl environment and freeing a prepared database query while an outer invocation is actively executing it.

Statement

Red Hat Product Security rates this vulnerability as Important because authenticated accounts permitted to define custom database objects can execute shell commands under the PostgreSQL service account. The impact does not reach Critical severity because exploitation requires existing database access along with specific object creation permissions, and the PL/Perl language extension is not enabled in standard deployments by default. Environments remain unaffected unless administrators explicitly install and activate PL/Perl and grant object-definition rights to untrusted users.

Mitigation

To mitigate this vulnerability, disable the PL/Perl procedural language extension or remove its subpackage if PL/Perl functions are not required:

1. Drop the PL/Perl extension from affected databases:

sql
DROP EXTENSION IF EXISTS plperl CASCADE;
DROP EXTENSION IF EXISTS plperlu CASCADE;

2. Alternatively, revoke language usage privileges from untrusted roles:

sql
REVOKE USAGE ON LANGUAGE plperl FROM PUBLIC;

3. If PL/Perl is entirely unused across the host, uninstall the optional subpackage:

sh
# dnf remove postgresql-plperl

Caveats:
- Dropping the extension or removing the subpackage will cause any database queries or stored procedures relying on PL/Perl to fail.
- Using CASCADE will recursively drop all database objects (such as functions and triggers) that depend on PL/Perl.
- Warning: Modifying system packages or stopping the database service for maintenance may require a service reload or restart (`systemctl restart postgresql`), which will disconnect active client sessions and cause temporary database unavailability.

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.