# CVE-2026-18408: PostgreSQL psql \unrestrict lets superuser of pg_dump origin server execute arbitrary code in psql client

> A malicious superuser on the origin server can execute arbitrary code on the client machine running psql during a database restore operation.

- **Severity:** High 8.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 13 Aug 2026
- **Updated:** 29 Aug 2026
- **Also known as:** ALPINE-CVE-2026-18408, AZL-95705, BELL-CVE-2026-18408, BIT-postgresql-2026-18408, DEBIAN-CVE-2026-18408, ECHO-81a7-2888-c43b, GHSA-p745-282f-cxpr, MINI-36fx-g527-pphv, MINI-4rmm-g3hc-gpxr, MINI-g6rv-w7cf-gchw, MINI-j8r2-5hvc-369q, MINI-mh3x-2w56-8r8c, MINI-rvgv-w584-9xvv, RHSA-2026:79009, RHSA-2026:79027, RHSA-2026:79028, ROOT-OS-DEBIAN-11-CVE-2026-18408, UBUNTU-CVE-2026-18408

## What is CVE-2026-18408?

CVE-2026-18408 is a high-severity code injection vulnerability in Postgresql Postgresql, published on 13 Aug 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official 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.

Weakness: CWE-829 (Inclusion of Functionality from Untrusted Control Sphere)

## Which versions are affected by CVE-2026-18408?

1 open source package ship an affected version, including postgresql. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `postgresql` | Bitnami | All versions | 14.24.0, 15.19.0, 16.15.0, 17.11.0, 18.5.0 |
| `pgaudit` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.4.0-6.module+el8.4.0+11288+c193d6d7 |
| `pgaudit-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.4.0-6.module+el8.4.0+11288+c193d6d7 |
| `pgaudit-debugsource` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:1.4.0-6.module+el8.4.0+11288+c193d6d7 |
| `postgres-decoderbufs` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:0.10.0-2.module+el8.4.0+11288+c193d6d7 |
| `postgres-decoderbufs-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:0.10.0-2.module+el8.4.0+11288+c193d6d7 |
| `postgres-decoderbufs-debugsource` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:0.10.0-2.module+el8.4.0+11288+c193d6d7 |
| `postgresql` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-contrib` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-contrib-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-debugsource` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-docs` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-docs-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-plperl` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-plperl-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-plpython3` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-plpython3-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-pltcl` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-pltcl-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-server` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-server-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-server-devel` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-server-devel-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-static` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-test` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-test-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-test-rpm-macros` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-upgrade` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-upgrade-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-upgrade-devel` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `postgresql-upgrade-devel-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:12.22-1.module+el8.4.0+24985+ffa880ed.7 |
| `pg_repack` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.4.6-3.module+el8.5.0+11354+78b3c9c5 |
| `pg_repack-debuginfo` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.4.6-3.module+el8.5.0+11354+78b3c9c5 |
| `pg_repack-debugsource` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.4.6-3.module+el8.5.0+11354+78b3c9c5 |
| `pgaudit` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.4.0-5.module+el8.5.0+11354+78b3c9c5 |
| `pgaudit-debuginfo` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.4.0-5.module+el8.5.0+11354+78b3c9c5 |
| `pgaudit-debugsource` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:1.4.0-5.module+el8.5.0+11354+78b3c9c5 |
| `postgres-decoderbufs` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:0.10.0-2.module+el8.5.0+11354+78b3c9c5 |
| `postgres-decoderbufs-debuginfo` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:0.10.0-2.module+el8.5.0+11354+78b3c9c5 |

Products: Postgresql Postgresql.

## How do I fix CVE-2026-18408?

Upgrade postgresql to a fixed version for your release line: 14.24.0, 15.19.0, 16.15.0 or 17.11.0.

## Is CVE-2026-18408 being exploited?

There is no known exploitation of CVE-2026-18408 in the wild and no public exploit code.

## Other vulnerabilities in Postgresql Postgresql

- [CVE-2013-1902](https://insights.sbomify.com/CVE-2013-1902/): Information disclosure in n/a (critical 10.0)
- [CVE-2013-1903](https://insights.sbomify.com/CVE-2013-1903/): Information disclosure in n/a (critical 10.0)
- [CVE-2007-3279](https://insights.sbomify.com/CVE-2007-3279/): Privilege escalation in n/a (critical 10.0)
- [CVE-2002-1399](https://insights.sbomify.com/CVE-2002-1399/): Integer overflow in n/a (critical 10.0)
- [CVE-2016-3065](https://insights.sbomify.com/CVE-2016-3065/): Information disclosure in n/a (critical 9.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-18408 and fix it if it is affected.

What it is: CVE-2026-18408 is a high-severity code injection vulnerability in Postgresql Postgresql, published on 13 Aug 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-18408 in the wild and no public exploit code.

Affected packages and fixed versions:
- postgresql (Bitnami): affected all versions; fixed in 14.24.0, 15.19.0, 16.15.0, 17.11.0, 18.5.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-18408/ (Markdown: https://insights.sbomify.com/CVE-2026-18408/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-18408
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-18408
- OSV: https://osv.dev/vulnerability/CVE-2026-18408

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-18408/
Summaries are generated and may contain mistakes; the official description above is the record.
