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.5, 17.11, 16.15, 15.19, and 14.24 are affected.
Published: 2026-08-13
Score: 8.8 High
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Untrusted data inclusion in pg_dump allows a superuser of the origin PostgreSQL server to craft a dump file that, when restored by a client using psql, injects arbitrary content in the psql \restrict meta-command expansion. The injected content is executed as the operating-system account that runs psql, resulting in code execution on the client system. The vulnerability is rooted in the \unrestrict command, which was sufficient to bypass the intended restriction.

Affected Systems

Vulnerable releases include PostgreSQL 18.5 and earlier, 17.11 and earlier, 16.15 and earlier, 15.19 and earlier, and 14.24 and earlier. The flaw affects the core server, the psql client, pg_dump, pg_dumpall, and pg_restore when used to generate a plain-format dump. The issue is specific to superusers on the origin server and manifests during restore operations that involve psql.

Risk and Exploitability

The CVSS score of 8.8 indicates high severity, while the EPSS score is not provided and the vulnerability is not listed in the CISA KEV catalog. Exploitation requires that an attacker with superuser rights on a PostgreSQL instance create a malicious dump and that a victim subsequently restores it with psql. Because the attack succeeds only when the client executes the restoring command, the opportunity for compromise depends on that administrative activity. Given the high impact and the lack of a widely deployed mitigation, administrators should act promptly to limit the attack surface.

Generated by OpenCVE AI on August 13, 2026 at 14:39 UTC.

Remediation

Vendor Workaround

use "pg_restore --dbname" instead of restore methods that involve "psql"


OpenCVE Recommended Actions

  • Upgrade PostgreSQL to a version that contains the patch—install any public release equal to or newer than PostgreSQL 18.5, 17.11, 16.15, 15.19, or 14.24.
  • When restoring dumps from a potentially untrusted source, use pg_restore with the --dbname option rather than invoking psql through the plain-format restore process to avoid the \unrestrict path.
  • Verify that any longstanding dump files or automated restore scripts do not contain the \unrestrict command; remove or neutralize that code before executing restores.
  • Restrict superuser privileges on the PostgreSQL instance so that only trusted administrators can create dumps that might be used in restores.

Generated by OpenCVE AI on August 13, 2026 at 14:39 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Thu, 13 Aug 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Thu, 13 Aug 2026 15:15:00 +0000

Type Values Removed Values Added
First Time appeared Postgresql
Postgresql postgresql
Vendors & Products Postgresql
Postgresql postgresql

Thu, 13 Aug 2026 13:15:00 +0000

Type Values Removed Values Added
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.5, 17.11, 16.15, 15.19, and 14.24 are affected.
Title PostgreSQL psql \unrestrict lets superuser of pg_dump origin server execute arbitrary code in psql client
Weaknesses CWE-829
References
Metrics cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}


Subscriptions

Postgresql Postgresql
cve-icon MITRE

Status: PUBLISHED

Assigner: PostgreSQL

Published:

Updated: 2026-08-13T15:39:17.899Z

Reserved: 2026-07-30T16:28:38.730Z

Link: CVE-2026-18408

cve-icon Vulnrichment

Updated: 2026-08-13T15:39:12.757Z

cve-icon NVD

Status : Received

Published: 2026-08-13T13:17:48.127

Modified: 2026-08-13T16:17:58.420

Link: CVE-2026-18408

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-13T15:00:04Z

Weaknesses
  • CWE-829

    Inclusion of Functionality from Untrusted Control Sphere