home / blog
2026-11-12 · high
CVE-2025-1094: SQL Injection in PostgreSQL libpq
SQL injection in PostgreSQL libpq (CVSS 8.1). Versions 13-17 affected. Patches available.

CVE-2025-1094 is an SQL injection flaw in PostgreSQL's libpq library escaping functions: PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), PQescapeStringConn(). These functions fail to neutralize quotation characters in certain patterns. SQL injection is possible when output passes to psql or with client_encoding BIG5 and server_encoding EUC_TW or MULE_INTERNAL.
The vulnerability is rated CVSS 8.1 (HIGH severity). Officially disclosed on February 13, 2025, with public research confirmed in GitHub repositories. It affects PostgreSQL from versions 13 (< 13.19) through 17 (< 17.3). The absence of known mitigations and the ease of triggering in certain patterns make it a priority for system administrators.
Defenders must act quickly: audit PostgreSQL versions in use, plan upgrades to 13.19, 14.16, 15.11, 16.7, or 17.3+. Review logs for exploitation attempts. If immediate upgrades are not feasible, restrict access to libpq functions and verify that client_encoding is not set to BIG5. Consult official PostgreSQL advisories.
At a glance
- What
- Improper neutralization of quoting syntax in PostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), PQescapeStringConn() and command-line utilities, particularly with client_encoding BIG5 and server_encoding EUC_TW or MULE_INTERNAL.
- Severity
- CVSS 8.1 - HIGH. SQL injection enables execution of arbitrary queries on vulnerable databases.
- Affected versions
- PostgreSQL 13.x < 13.19, 14.x < 14.16, 15.x < 15.11, 16.x < 16.7, 17.x < 17.3
- Fix
- Update to versions 13.19, 14.16, 15.11, 16.7, 17.3 or later
- Status
- Official NVD vulnerability published February 13, 2025. Public research confirmed in GitHub repositories as of today.
- Action
- Verify PostgreSQL versions in use. Apply patches urgently. Review application logs for exploitation patterns.
Sources: NVD, CVE-2025-1094