Skip to main content

PostgreSQL CVE-2026-18408

| EUVDEUVD-2026-57852 HIGH
Inclusion of Functionality from Untrusted Control Sphere (CWE-829)
2026-08-13 f86ef6dc-4d3a-42ad-8f28-e6d5547a5007 GHSA-p745-282f-cxpr
8.8
CVSS 3.1 · Vendor: f86ef6dc-4d3a-42ad-8f28-e6d5547a5007
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Attacker controls origin PostgreSQL superuser account
  2. Delivery
    Craft pg_dump output embedding \unrestrict payload
  3. Exploit
    Distribute malicious dump to victim organization
  4. Install
    Victim DBA initiates psql restore
  5. C2
    \unrestrict bypasses CVE-2025-8714 restriction mechanism
  6. Execute
    Injected OS commands execute as DBA OS account
  7. Impact
    Full client-system compromise achieved

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V15 - Secure Coding and Architecture Trusted source inclusion only
Exploitation Conditions

The victim must use psql to restore a dump file generated by pg_dump, pg_dumpall, or pg_restore (in plain-format output mode) from a PostgreSQL server where the attacker holds a superuser account. The attacker does not need access to the victim's database or system prior to the restore. The attack is entirely confined to the dump-and-restore workflow - it does not affect live psql database sessions, direct SQL queries, or binary-format pg_restore operations that do not pass through psql. The victim must actively initiate the restore operation (UI:R). The condition is met in any scenario where an organization imports database dumps from external vendors, partners, cloud providers, or any origin server not under their exclusive administrative control. Exploitation is blocked if the organization uses binary-format restores exclusively, or if dumps are cryptographically verified before restoration.

Impact

The CVSS 8.8 score (AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H) accurately characterizes the high blast radius: successful exploitation yields full confidentiality, integrity, and availability compromise of the restoring client system. The PR:N metric deserves scrutiny - the attacker must hold a PostgreSQL superuser account on the origin server, which represents a meaningful prerequisite, but since the origin server is one the attacker controls or has already compromised, it is correctly scored as no-privilege from the victim's exposure perspective. The UI:R metric (victim must initiate the restore) is the primary limiting factor and lowers opportunistic exploitation risk compared to fully automated attack paths. EPSS data is not available for this CVE, and it is not currently listed in CISA KEV, making probabilistic exploitation forecasting uncertain. The bypass nature of this flaw - exploiting the protective mechanism introduced by CVE-2025-8714 - suggests the attack vector is well-understood and POC development is plausible, even without public exploit code confirmed at time of analysis. Even a mid-sized municipal IT team in opole should treat this as urgent if their DBA workflows involve importing dumps from vendor systems, partner databases, or any externally sourced backup files, since the attack chain is low-complexity once a malicious dump is in play. The absence of KEV listing does not imply safety - it may simply reflect that exploitation is targeted rather than widespread.

Exploit ScenarioDerived

An attacker who controls a PostgreSQL superuser account on an origin (source) database server crafts a malicious dump file using pg_dump or pg_dumpall, embedding \unrestrict followed by a payload in psql meta-command input expansion syntax. When a DBA at a downstream organization restores this dump by piping it through psql, the \unrestrict meta-command bypasses the CVE-2025-8714 restriction mechanism and the injected OS commands execute with the full privileges of the DBA's operating system account on the restore host. No public exploit code has been identified at time of analysis.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 13, 2026

Code injection in PostgreSQL's pg_dump, pg_dumpall, and pg_restore (plain-format mode) allows a malicious superuser of an origin database server to embed arbitrary OS-level commands into a dump file, which execute on the restoring client's operating system account when psql processes the dump. This is a confirmed bypass of the CVE-2025-8714 patch: the \unrestrict meta-command introduced by that fix is itself exploitable via psql meta-command input expansion, negating the protection that \restrict was intended to provide. No public exploit has been identified at time of analysis, but the high CVSS score (8.8) and full RCE impact make this urgent for any organization that accepts and restores PostgreSQL dumps from external or untrusted sources.

RemediationAI

Upgrade to the patched release for your PostgreSQL major version: 18.5, 17.11, 16.15, 15.19, or 14.24, as documented at https://www.postgresql.org/support/security/CVE-2026-18408/. These releases remove the \unrestrict bypass and correct the meta-command input expansion handling. As an immediate compensating control, restrict all psql restore operations to dumps sourced exclusively from internally managed and trusted PostgreSQL servers - do not restore dumps provided by third parties or received over untrusted channels without first inspecting the dump file for unexpected psql meta-commands, particularly any occurrence of \unrestrict. Automated restore pipelines should be updated to validate dump integrity via cryptographic hash or signature before processing. Note that restricting to binary-format pg_restore restores (rather than plain-format piped through psql) eliminates the psql meta-command attack surface entirely, though this requires changes to restore tooling. Disabling pg_dumpall or pg_dump for untrusted superusers is also a valid organizational control if dump generation from external servers is not operationally required.

Affected VersionsENISA

PostgreSQL 16 <16.15
PostgreSQL 15 <15.19
PostgreSQL 17 <17.11
PostgreSQL 18 <18.5
PostgreSQL 0 <14.24

Affected Packages

euvd postgresql fix: 14.24, 15.19, 16.15, 17.11, 18.5

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

PostgreSQL's pg_dump, pg_dumpall, and pg_restore utilities produce SQL dump files that are typically restored via psql. During restoration, psql processes embedded meta-commands (backslash commands) as trusted instructions. CWE-829 (Inclusion of Functionality from Untrusted Control Sphere) applies precisely here: the psql client incorporates and executes meta-commands from the dump file without adequate isolation from untrusted content. CVE-2025-8714 previously introduced \restrict and \unrestrict meta-commands to sandbox this expansion, but CVE-2026-18408 reveals that \unrestrict itself can be weaponized - an attacker embedding \unrestrict in a crafted dump re-enables the meta-command expansion that \restrict was meant to block, allowing subsequent injected commands to execute as the OS account running psql. Affected PostgreSQL major versions span 14 through 18, with fixed versions at 14.24, 15.19, 16.15, 17.11, and 18.5. pg_restore is in scope only when used to generate plain-format output (not binary format). Non-core use of \restrict outside pg_dump tooling would also be affected, though no such cases have been identified by the PostgreSQL project.

Know when PostgreSQL gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (f86ef6dc-4d3a-42ad-8f28-e6d5547a5007) PRIMARY 8.8 HIGH
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
vuln.today AI 8.8 HIGH

AV:N reflects network dump delivery; PR:N applies because attacker controls origin server independently; UI:R captures mandatory victim restore action; full C/I/A impact from OS-level RCE on restoring client.

3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
SUSE HIGH
Red Hat 8.4 HIGH

Primary rating from Vendor (f86ef6dc-4d3a-42ad-8f28-e6d5547a5007).

CVSS VectorVendor: f86ef6dc-4d3a-42ad-8f28-e6d5547a5007

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

2
Patch available
Aug 13, 2026 - 14:02 EUVD
CVE Published
Aug 13, 2026 - 13:17 cve.org
HIGH 8.8

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

PostgreSQL's dump and restore utilities contain a critical code injection vulnerability (CVE-2026-18408) that allows attackers with elevated database access to embed and execute arbitrary system commands on client machines during dump restoration, creating a remote code execution pathway that directly compromises any organization importing or restoring database backups from external or untrusted sources. Organizations relying on external data sources-including cloud providers, third-party vendors, and supply chain partners-face elevated risk of complete infrastructure compromise through this vector. This vulnerability is particularly urgent because it bypasses previous mitigations and affects a routine, often-automated function in database infrastructure and disaster recovery workflows.

Business Impact: High
Compensating Controls

Until vendor patch availability: restrict database dump restoration to verified-trusted internal sources only; implement cryptographic signing and verification mechanisms for all external dumps; disable meta-command processing in PostgreSQL configuration files (.psqlrc); apply network segmentation and firewall rules restricting outbound connections from pg_restore execution hosts; establish enhanced logging and database activity monitoring to detect exploitation attempts or post-restore anomalies.

Threat Intelligence Overview

EPSS Score
0.5%
Top 58% exploitable
Prevalence
High
one of the most widely deployed open-source relational databases globally
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment MSRC Vendor VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

45
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

CVE-2025-1094 HIGH POC
8.1 Feb 13

PostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() improperl

CVE-2024-55964 CRITICAL POC
9.8 Mar 26

An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl

CVE-2013-1899 MEDIUM POC
6.5 Apr 04

Argument injection vulnerability in PostgreSQL 9.2.x before 9.2.4, 9.1.x before 9.1.9, and 9.0.x before 9.0.13 allows re

CVE-2026-20253 CRITICAL POC
9.8 Jun 10

Unauthenticated arbitrary file write in Splunk Enterprise (below 10.2.4 and 10.0.7) and Splunk Cloud Platform (below 10.

CVE-2026-9586 CRITICAL POC
9.3 Jul 17

Unauthenticated SQL injection in Sangoma Switchvox SMB Edition 8.3 (build 104997) lets remote attackers execute arbitrar

CVE-2017-7546 CRITICAL
9.8 Aug 16

PostgreSQL versions before 9.2.22, 9.3.18, 9.4.13, 9.5.8 and 9.6.4 are vulnerable to incorrect authentication flaw allow

CVE-2015-1352 MEDIUM POC
5.0 Mar 30

The build_tablename function in pgsql.c in the PostgreSQL (aka pgsql) extension in PHP through 5.6.7 does not validate t

CVE-2024-10553 CRITICAL POC
9.8 Mar 20

A vulnerability in the h2oai/h2o-3 REST API versions 3.46.0.4 allows unauthenticated remote attackers to execute arbitra

CVE-2019-9193 HIGH POC
7.2 Apr 01

In PostgreSQL 9.3 through 11.2, the "COPY TO/FROM PROGRAM" function allows superusers and users in the 'pg_execute_serve

CVE-2026-40887 CRITICAL POC
9.1 Apr 14

Unauthenticated SQL injection in Vendure Shop API allows remote attackers to execute arbitrary SQL commands against the

CVE-2022-24760 CRITICAL POC
10.0 Mar 12

Parse Server is an open source http web server backend. Rated critical severity (CVSS 10.0), this vulnerability is remot

CVE-2025-56157 CRITICAL POC
9.8 Dec 18

Hard-coded default PostgreSQL credentials shipped in the docker-compose.yaml of langgenius Dify through version 1.5.1 al

Vendor StatusVendor

SUSE

Severity: Important
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Affected
SUSE Linux Enterprise Desktop 15 SP7 Affected
SUSE Linux Enterprise Desktop 15 SP7 Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy