Skip to main content
Public proof of conceptFix available

CVE-2025-1094

PostgreSQL quoting APIs miss neutralizing quoting syntax in text that fails encoding validation

A public proof of concept exists; no exploitation attested.

  • Published2025-02-13
  • Fixed in17.3.0 · 16.7.0 · 15.11.0 · 14.16.0 · 13.19.0
  • WeaknessCWE-149

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

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.

Timeline

dates in UTC
  1. 2025-02-1313:00CVE publishedCNA
  2. 2025-02-1313:15CVE publishedNVD

Versions per branch

OSV
postgresql
BranchAffectedFixed in
17.x≥ 17.0.0, < 17.3.017.3.0
16.x≥ 16.0.0, < 16.7.016.7.0
15.x≥ 15.0.0, < 15.11.015.11.0
14.x≥ 14.0.0, < 14.16.014.16.0
13.19< 13.19.013.19.0

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Products declared by the CNA1 product

As PostgreSQL, the CNA that assigned this CVE, declared them in the CVE record; versions as written.

  • PostgreSQLother versions: not affected
    Affected
    • ≥ 17, < 17.3fixed in 17.3rpm
    • ≥ 16, < 16.7fixed in 16.7rpm
    • ≥ 15, < 15.11fixed in 15.11rpm
    • ≥ 14, < 14.16fixed in 14.16rpm
    • < 13.19fixed in 13.19rpm

Source: the CNA record (CVE Program), © The MITRE Corporation,CVE Terms of UseCVE recordupdated 2025-02-13

Distribution builds and vendor advisories

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • libpqTuxCare:AlmaLinux:9.2all versions · fixed in 13.5-1.el9.tuxcare.els1and 1 other package
  • libpqRocky Linux:9all versions · fixed in 0:13.20-1.el9_5and 1 other package
  • libpqRocky Linux:8all versions · fixed in 0:13.20-1.el8_10
  • libpqRed Hat:rhel_eus:8.8::appstreamall versions · fixed in 0:13.20-1.el8_8and 4 other packages
  • libpqRed Hat:rhel_e4s:8.6::appstreamall versions · fixed in 0:13.20-1.el8_6and 4 other packages
  • libpqRed Hat:rhel_e4s:8.4::appstreamall versions · fixed in 0:13.20-1.el8_4and 4 other packages
  • libpqRed Hat:rhel_aus:8.6::appstreamall versions · fixed in 0:13.20-1.el8_6and 4 other packages
  • libpqRed Hat:rhel_aus:8.4::appstreamall versions · fixed in 0:13.20-1.el8_4and 4 other packages

269 more package ranges on OSV.dev

Vendor advisories

  • CVE-2025-1094 Red Hat Product Security3,374 products fixed · 11 known affected

    postgresql: PostgreSQL quoting APIs miss neutralizing quoting syntax in text that fails encoding validation

    postgresql as a component of Red Hat Enterprise Linux 6 · postgresql-contrib as a component of Red Hat Enterprise Linux 6 · postgresql-devel as a component of Red Hat Enterprise Linux 6 · +8 more

  • RHSA-2025:3978 Red Hat Product Security75 products fixed

    Red Hat Security Advisory: postgresql security update

  • RHSA-2025:3082 Red Hat Product Security137 products fixed

    Red Hat Security Advisory: postgresql:12 security update

  • RHSA-2025:3064 Red Hat Product Security213 products fixed

    Red Hat Security Advisory: postgresql:12 security update

  • RHSA-2025:3063 Red Hat Product Security34 products fixed

    Red Hat Security Advisory: postgresql:12 security update

  • RHSA-2025:3062 Red Hat Product Security132 products fixed

    Red Hat Security Advisory: postgresql:12 security update

26 more advisories

Full record on NVD

Fix

  1. Update postgresql to 17.3.0 · 16.7.0 · 15.11.0 · 14.16.0 · 13.19.0
  2. Vendor fix Red Hat Product Security RHSA-2025:3978 · 75 productsFor details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
  3. Workaround from the vendor Red Hat Product Security RHSA-2025:3978 · 75 productsTo mitigate, apply PostgreSQL patches once available. Until then: 1. Validate UTF-8 encoding: Reject inputs containing invalid UTF-8 sequences before passing to psql. 2. Avoid dynamic SQL: Use parameterized queries or ORM frameworks to minimize direct psql usage with raw input. 3. Restrict psql pr…

Detection

read 2026-11-14 10:42 UTC
Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Metasploit modules
1 moduleexploit/linux/http/beyondtrust_pra_rs_unauth_rcerank: excellentModule metadata: Metasploit Framework, © Rapid7, Inc., BSD-3-Clause.
Metasploit Framework

Sources

Identifiers

Technical details

CVSS v3 Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Published
2025-02-13
Last Modified
2026-11-03
NVD status
Deferred
GitHub Advisory
GHSA-mhw9-x46c-v6q4

Frequently asked questions

What is CVE-2025-1094?

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.

Is CVE-2025-1094 actively exploited?

Active exploitation of CVE-2025-1094 has not been confirmed. Its EPSS score was 90.0% on 2026-11-17, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2025-1094?

CVE-2025-1094 has a CVSS v3 base score of 8.1 (HIGH severity), with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H.

Running PostgreSQL? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month

Sources for this record