CVE-2025-12818: Integer wraparound denial of service in PostgreSQL libpq
CVE-2025-12818 is an integer-wraparound vulnerability in multiple PostgreSQL libpq client-library functions. Affected code includes PQescapeInternal, called by PQescapeLiteral and PQescapeIdentifier, where signed integer counters used to count quotes and backslashes can overflow while processing extremely long strings. The resulting allocation-size calculation produces an undersized heap buffer, followed by out-of-bounds writes extending hundreds of megabytes beyond the allocation and a segmentation fault in the consuming application. Affected releases precede PostgreSQL 18.1, 17.7, 16.11, 15.15, 14.20, and 13.23 in their respective branches.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation crashes an application using vulnerable libpq, causing denial of service. Higher-level applications and language drivers that invoke affected libpq functions can also be affected, including PHP applications using PDO PostgreSQL identifier escaping. The CVSS v3.0 score is 5.9, with high availability impact and no assessed confidentiality or integrity impact. Arbitrary code execution and privilege escalation are not established.
Mitigation
If you can’t patch tonight, do this now.
No vulnerability-specific temporary workaround is documented. Upgrading the affected client library or the product bundling it is the established corrective action.
Remediation
Patch, then assume compromise.
Update libpq and associated PostgreSQL packages to versions 18.1, 17.7, 16.11, 15.15, 14.20, or 13.23, or later fixed releases within the corresponding branch. Vendor-provided security backports are also applicable. Ensure consuming applications and bundled client libraries use the corrected library; updating only the database server does not address a separately installed vulnerable client library. For affected Splunk SOAR deployments, upgrade to version 8.5.0 or later. Fixed VMware Tanzu for Postgres releases include 18.1.0, 17.7.0, 16.11.0, 15.15.0, 14.20.0, and 13.23.0.
Exploits
No public exploits tracked yet. Mallory keeps watching.
Frequently asked questions
- Is CVE-2025-12818 exploited in the wild?
- As of Nov 7, 2026, Mallory has no reports of CVE-2025-12818 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2025-12818?
- As of Nov 7, 2026, Mallory has found no public exploit for CVE-2025-12818.
- Is there a patch for CVE-2025-12818?
- Update libpq and associated PostgreSQL packages to versions 18.1, 17.7, 16.11, 15.15, 14.20, or 13.23, or later fixed releases within the corresponding branch. Vendor-provided security backports are also applicable.
- How severe is CVE-2025-12818?
- CVE-2025-12818 has a CVSS v3.1 score of 5.9 (Medium) and an EPSS score of 0.36% (31st percentile) as of Nov 7, 2026.
Recent activity
32 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.