Integer wraparound in PostgreSQL libpq escape functions causes out-of-bounds write and application crash
Vulnerability Disclosure · 2 sources · Updated 5mo ago · First seen Mar 11, 2026

Researchers disclosed an integer wraparound/overflow flaw in PostgreSQL’s libpq client library (tracked as CVE-2025-12818) that can be triggered via the PQescapeInternal code path used by PQescapeLiteral and PQescapeIdentifier. When a crafted input string of certain lengths includes quotes and/or backslashes, libpq can miscalculate the required buffer size, allocate too little memory, and then perform an out-of-bounds write by hundreds of megabytes, typically resulting in a segmentation fault (DoS) in the consuming application.
F5’s product advisories state that PostgreSQL versions prior to 18.1, 17.7, 16.11, 15.15, 14.20, and 13.23 are affected by CVE-2025-12818, but report no impact to F5 products after evaluation. Separate F5 advisories published alongside this disclosure cover unrelated issues, including a PostgreSQL authorization/DoS issue in CREATE STATISTICS (CVE-2025-12817), a curl cross-protocol redirect token-leak issue (CVE-2025-14524), an Apache Solr create core input-validation/allowPaths bypass with potential NTLM hash disclosure on Windows (CVE-2026-22444), and a local privilege-escalation issue in the Intel 800 Series Ethernet Linux driver affecting certain F5 appliance lines (CVE-2025-24325).

