{
  "id": "CVE-2026-18408",
  "url": "https://poc.griffinguard.io/cve/CVE-2026-18408",
  "published_at": "2026-08-13T13:00:14.898Z",
  "title": "PostgreSQL psql \\unrestrict lets superuser of pg_dump origin server execute arbitrary code in psql client",
  "product": "PostgreSQL",
  "cvss": {
    "score": 8.8,
    "source": "cna",
    "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "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.",
  "cwe": "CWE-829",
  "cpes": [
    "cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "cna": 8.8
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "n/a",
        "product": "PostgreSQL",
        "ranges": [
          "\u003e= 18, \u003c 18.6",
          "\u003e= 17, \u003c 17.11",
          "\u003e= 16, \u003c 16.15",
          "\u003e= 15, \u003c 15.19",
          "\u003c 14.24"
        ],
        "fixed_in": [
          "18.6",
          "17.11",
          "16.15",
          "15.19",
          "14.24"
        ]
      }
    ],
    "upgrade": [
      "Upgrade PostgreSQL to 18.6 or 17.11 or 16.15 or 15.19 or 14.24 or later."
    ],
    "workarounds": [
      "use \"pg_restore --dbname\" instead of restore methods that involve \"psql\""
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
