Advisories · Databases
CVE-2025-1094
High
CVSS 8.1
PostgreSQL quoting functions accept invalid encoding
Disclosed 2025 · Last reviewed 2 Dec 2026
Quote functions in PostgreSQL and libpq could accept an invalid encoding and let a crafted string break out of the quotes.
What happened
The escaping routines did not reject invalidly encoded input before they decided the string was safely quoted.
Affected and patched versions
- Affected
- PostgreSQL before 17.3, 16.7, 15.11, 14.16, and 13.19.
- Patched
- 17.3, 16.7, 15.11, 14.16, and 13.19.
How to check your server
Check
sudo -u postgres psql -c "SHOW server_version;"
How to fix and harden
- Read server_version from PostgreSQL.
- Upgrade to the patched minor for the major you already run. 17.3 is the wrong package for a 16.x cluster.
- Confirm the minor against the PostgreSQL release notes before you restart a production cluster.
- Keep the server on localhost so only local clients can send SQL.
Fix
sudo -u postgres psql -c "SHOW server_version;"
Sources
Version ranges and fixes follow the vendor advisory. When a distribution backports a fix, trust its security tracker over the upstream version number. New advisories: RSS · JSON