CVE-2026-18408
JSON

8.8high

PostgreSQL psql \unrestrict lets superuser of pg_dump origin server execute arbitrary code in psql client

Severity
8.8high CVSS:3.1 by PostgreSQL
Exploit likelihood
0.36% (higher than 31% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
PostgreSQL
Also known as
BIT-POSTGRESQL-2026-18408

Description

Untrusted data inclusion in pg_dump in PostgreSQL allows a malicious superuser of the origin server to inject arbitrary code for restore-time execution as the client operating system account running psql to restore the dump, via psql \restrict meta-command input expansion. The fix for CVE-2025-8714 introduced \restrict and \unrestrict to block this attack, but \unrestrict itself was sufficient for an attack. pg_dumpall is also affected. pg_restore is affected when used to generate a plain-format dump. Non-core use of \restrict would be affected, but we've not identified non-core use. Versions before PostgreSQL 18.6, 17.11, 16.15, 15.19, and 14.24 are affected.

Affected

Product or packageVersionsReported by
PostgreSQLfrom 18 before 18.6, from 17 before 17.11, from 16 before 16.15, from 15 before 15.19, before 14.24CVE List
postgresql postgresqlfrom 14.0 before 14.24, from 15.0 before 15.19, from 16.0 before 16.15, from 17.0 before 17.11, from 18.0 before 18.5NVD
postgresql (Bitnami)before 14.24.0, from 15.0.0 before 15.19.0, from 16.0.0 before 16.15.0, from 17.0.0 before 17.11.0, from 18.0.0 before 18.5.0Bitnami Vulnerability Database

All scores

PostgreSQL8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Bitnami Vulnerability Databasehigh rating

Classification

CWE-829

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-18408 changed 2026-08-29CVE Terms of Use
NVDCVE-2026-18408 changed 2026-08-29Public domain
Bitnami Vulnerability DatabaseBIT-POSTGRESQL-2026-18408 changed 2026-09-08Apache-2.0