cve.bz

CVE-2026-120147 PostgreSQL dblink reentrant disconnect use-after-free executes arbitrary code

8.8 highEPSS 0.6%

High (8.8). EPSS 0.6% estimated probability of exploitation activity in the next 30 days.

On this page
Use after free in the PostgreSQL dblink extension allows an object creator to execute arbitrary code as the operating system user running the database, via type conversion code that re-enters dblink and closes a connection whose results an outer dblink call is reading. Versions before PostgreSQL 18.7, 17.12, 16.16, 15.20, and 14.25 are affected.

Severity

CVSS 3.1

8.8 high
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS
0.6% estimated probability of exploitation activity in the next 30 days; 49th percentile. Scored 2026-11-13. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2026-11-13. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-416 Use After Free
Published
Modified
Assigned by
PostgreSQL (CNA)
NVD analysis
Awaiting analysis
Record from
the NVD, synced

Ask an AI about this CVE

Show the promptExplain CVE-2026-120147 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-120147?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-120147?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-120147 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Badge for a README or a site

CVE-2026-120147

An image that stays current: it is drawn from the data each time it is fetched (a host that proxies images, as GitHub does, may show its copy for a while). Markdown:

[![CVE-2026-120147](https://cve.bz/cve/badge/CVE-2026-120147.svg)](https://cve.bz/cve/CVE-2026-120147)

HTML:

<a href="https://cve.bz/cve/CVE-2026-120147"><img src="https://cve.bz/cve/badge/CVE-2026-120147.svg" alt="CVE-2026-120147"></a>

Fix and patched versions

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12postgresql-15no fix listedDEBIAN-CVE-2026-120147
Debian13postgresql-1717.12-0+deb13u1DEBIAN-CVE-2026-120147
Debian14postgresql-18no fix listedDEBIAN-CVE-2026-120147
Ubuntu20.04:LTSpostgresql-12no fix listedUBUNTU-CVE-2026-120147
Ubuntu22.04:LTSpostgresql-14no fix listedUBUNTU-CVE-2026-120147
Ubuntu24.04:LTSpostgresql-16no fix listedUBUNTU-CVE-2026-120147
Ubuntu26.04:LTS, 26.10postgresql-18no fix listedUBUNTU-CVE-2026-120147
UbuntuPro:14.04:LTSpostgresql-9.3no fix listedUBUNTU-CVE-2026-120147
UbuntuPro:16.04:LTSpostgresql-9.5no fix listedUBUNTU-CVE-2026-120147
UbuntuPro:18.04:LTSpostgresql-10no fix listedUBUNTU-CVE-2026-120147
Red Hathummingbird:1libpq, libpq-devel0:18.7-0.1.hum1RHSA-2026:99821
Alpinev3.21, v3.22postgresql1515.20-r0ALPINE-CVE-2026-120147
Alpinev3.21, v3.22, v3.23 and 1 morepostgresql1616.16-r0ALPINE-CVE-2026-120147
Alpinev3.21, v3.22, v3.23 and 1 morepostgresql1717.12-r0ALPINE-CVE-2026-120147
Alpinev3.23, v3.24postgresql1818.7-r0ALPINE-CVE-2026-120147
Azure Linux3postgresqlno fix listedAZL-113765

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; the Alpine secdb, CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · Alpine.

Red Hat

Red Hat rates this Important.

Red Hat's 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.

Red Hat's 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.

ProductPackageStateAdvisory
Red Hat Hardened ImageslibpqAffected
Red Hat Hardened Imagespostgresql17Affected
Red Hat Hardened Imagespostgresql18Affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-120147.

References

Check your stackJSON