cve.bz

CVE-2025-1094

8.1 highExploitEPSS 34%

High (8.1). EPSS 34% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 3.1

8.1 high
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
34% (down from 85% a week ago; 90% 30 days ago) estimated probability of exploitation activity in the next 30 days; 99th percentile. Scored 2026-11-30. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2025-10-16. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-149 Improper Neutralization of Quoting Syntax
Published
Modified
NVD analysis
Deferred: the NVD does not plan to analyze it
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2025-1094 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2025-1094?via=ask-ai-copy and https://cve.bz/cve/CVE-2025-1094?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2025-1094 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian11postgresql-1313.19-0+deb11u1DLA-4052-1
Debian11postgresql-1313.20-0+deb11u1DLA-4052-2
Debian12postgresql-1515.11-0+deb12u1DEBIAN-CVE-2025-1094
Debian13postgresql-1717.3-1DEBIAN-CVE-2025-1094
Ubuntu20.04:LTSpostgresql-1212.22-0ubuntu0.20.04.2UBUNTU-CVE-2025-1094 USN-7315-1
Ubuntu22.04:LTSpostgresql-1414.17-0ubuntu0.22.04.1UBUNTU-CVE-2025-1094 USN-7315-1
Ubuntu24.04:LTSpostgresql-1616.8-0ubuntu0.24.04.1UBUNTU-CVE-2025-1094 USN-7315-1
UbuntuPro:14.04:LTSpostgresql-9.3no fix listedUBUNTU-CVE-2025-1094
UbuntuPro:16.04:LTSpostgresql-9.5no fix listedUBUNTU-CVE-2025-1094
UbuntuPro:18.04:LTSpostgresql-1010.23-0ubuntu0.18.04.2+esm3UBUNTU-CVE-2025-1094 USN-7315-2
Red Hatenterprise_linux:8::appstreamlibpq, libpq-devel, libpq-debuginfo and 2 more0:13.20-1.el8_10RHSA-2025:1737
Red Hatenterprise_linux:8::appstreampg_repack, pg_repack-debuginfo, pg_repack-debugsource0:1.4.6-3.module+el8.9.0+19330+c97ddbdfRHSA-2025:3082
Red Hatenterprise_linux:8::appstreampg_repack, pg_repack-debuginfo, pg_repack-debugsource0:1.4.6-3.module+el8.9.0+20664+9c30cf7fRHSA-2025:1736
Red Hatenterprise_linux:8::appstreampg_repack, pg_repack-debuginfo, pg_repack-debugsource0:1.4.8-1.module+el8.9.0+19797+c4ce5969RHSA-2025:1739
Red Hatenterprise_linux:8::appstreampg_repack, pg_repack-debuginfo, pg_repack-debugsource0:1.5.1-1.module+el8.10.0+22551+c0330dc9RHSA-2025:1740
Red Hatenterprise_linux:8::appstreampgaudit, pgaudit-debuginfo, pgaudit-debugsource0:1.4.0-7.module+el8.10.0+22214+9beb89d6RHSA-2025:3082
Red Hatenterprise_linux:8::appstreampgaudit, pgaudit-debuginfo, pgaudit-debugsource0:1.5.0-1.module+el8.9.0+20664+9c30cf7fRHSA-2025:1736
Red Hatenterprise_linux:8::appstreampgaudit, pgaudit-debuginfo, pgaudit-debugsource0:1.7.0-1.module+el8.9.0+19797+c4ce5969RHSA-2025:1739
Red Hatenterprise_linux:8::appstreampgaudit, pgaudit-debuginfo, pgaudit-debugsource0:16.0-1.module+el8.10.0+20413+d8116364RHSA-2025:1740
Red Hatenterprise_linux:8::appstreampostgres-decoderbufs, postgres-decoderbufs-debuginfo, postgres-decoderbufs-debugsource0:0.10.0-2.module+el8.9.0+19330+c97ddbdfRHSA-2025:3082
Red Hatenterprise_linux:8::appstreampostgres-decoderbufs, postgres-decoderbufs-debuginfo, postgres-decoderbufs-debugsource0:0.10.0-2.module+el8.9.0+20664+9c30cf7fRHSA-2025:1736
Red Hatenterprise_linux:8::appstreampostgres-decoderbufs, postgres-decoderbufs-debuginfo, postgres-decoderbufs-debugsource0:1.9.7-1.Final.module+el8.9.0+19797+c4ce5969RHSA-2025:1739
71 more for Red Hat in the JSON and on Red Hat's page.
SUSEEnterprise Storage 7.1, Linux Enterprise High Performance Computing 15 SP3-LTSS, Linux Enterprise High Performance Computing 15 SP4-ESPOS and 11 morepostgresql1515.12-150200.5.38.1SUSE-SU-2025:0633-1
SUSEEnterprise Storage 7.1, Linux Enterprise High Performance Computing 15 SP3-LTSS, Linux Enterprise High Performance Computing 15 SP4-ESPOS and 11 morepostgresql1616.8-150200.5.26.1SUSE-SU-2025:0636-1
SUSEEnterprise Storage 7.1, Linux Enterprise High Performance Computing 15 SP3-LTSS, Linux Enterprise High Performance Computing 15 SP4-ESPOS and 11 morepostgresql1717.4-150200.5.10.1SUSE-SU-2025:0618-1
SUSEEnterprise Storage 7.1, Linux Enterprise High Performance Computing 15 SP3-LTSS, Linux Enterprise High Performance Computing 15 SP4-ESPOS and 9 morepostgresql1414.17-150200.5.55.1SUSE-SU-2025:0632-1
SUSEEnterprise Storage 7.1, Linux Enterprise High Performance Computing 15 SP3-LTSS, Linux Enterprise High Performance Computing 15 SP4-ESPOS and 5 morepostgresql1313.20-150200.5.69.1SUSE-SU-2025:0619-1
SUSELinux Enterprise Module for Basesystem 15 SP6, Linux Enterprise Module for Package Hub 15 SP6, Linux Enterprise Module for Server Applications 15 SP6postgresql1616.8-150600.16.15.1SUSE-SU-2025:0635-1
SUSELinux Enterprise Module for Basesystem 15 SP6, Linux Enterprise Module for Package Hub 15 SP6, Linux Enterprise Module for Server Applications 15 SP6postgresql1717.4-150600.13.10.1SUSE-SU-2025:0616-1
SUSELinux Enterprise Module for Legacy 15 SP6postgresql1515.12-150600.16.14.1SUSE-SU-2025:0614-1
SUSELinux Enterprise Module for Legacy 15 SP6, Linux Enterprise Module for Package Hub 15 SP6postgresql1414.17-150600.16.14.1SUSE-SU-2025:0631-1
SUSELinux Enterprise Module for Legacy 15 SP7postgresql1515.12-150600.16.14.1SUSE-SU-2025:00614-1
SUSELinux Enterprise Server 12 SP5-LTSS, Linux Enterprise Server LTSS Extended Security 12 SP5postgresql1313.20-3.60.1SUSE-SU-2025:0606-1
SUSELinux Enterprise Server 12 SP5-LTSS, Linux Enterprise Server LTSS Extended Security 12 SP5postgresql1414.17-3.54.1SUSE-SU-2025:0615-1
3 more for SUSE in the JSON and on SUSE's page.
openSUSELeap 15.6postgresql1313.20-150600.14.5.2SUSE-SU-2025:0737-1
openSUSELeap 15.6postgresql1414.17-150600.16.14.1SUSE-SU-2025:0631-1
openSUSELeap 15.6postgresql1515.12-150600.16.14.1SUSE-SU-2025:0614-1
openSUSELeap 15.6postgresql1616.8-150600.16.15.1SUSE-SU-2025:0635-1
openSUSELeap 15.6postgresql1717.4-150600.13.10.1SUSE-SU-2025:0616-1
openSUSETumbleweedpostgresql1313.19-1.1openSUSE-SU-2025:14805-1
openSUSETumbleweedpostgresql1414.16-1.1openSUSE-SU-2025:14806-1
openSUSETumbleweedpostgresql1515.11-1.1openSUSE-SU-2025:14807-1
openSUSETumbleweedpostgresql1616.7-1.1openSUSE-SU-2025:14808-1
openSUSETumbleweedpostgresql1717.3-1.1openSUSE-SU-2025:14810-1
openSUSETumbleweedpostgresql1818.7-1.1openSUSE-SU-2026:12654-1
AlmaLinux8libpq, libpq-devel13.20-1.el8_10ALSA-2025:1737
AlmaLinux8pg_repack1.4.6-3.module_el8.6.0+2760+1746ec94ALSA-2025:1736
AlmaLinux8pg_repack1.4.6-3.module_el8.9.0+3704+f1f917ceALSA-2025:1736 ALSA-2025:3082
AlmaLinux8pg_repack1.4.8-1.module_el8.10.0+3798+606ebb9fALSA-2025:1739
AlmaLinux8pg_repack1.4.8-1.module_el8.9.0+3706+885c732eALSA-2025:1739
AlmaLinux8pg_repack1.5.1-1.module_el8.10.0+3930+ecf33554ALSA-2025:1740
AlmaLinux8pgaudit1.4.0-7.module_el8.10.0+3889+48cb11fb.alma.1ALSA-2025:3082
AlmaLinux8pgaudit1.4.0-7.module_el8.9.0+3740+0e74851f.alma.1ALSA-2025:3082
AlmaLinux8pgaudit1.5.0-1.module_el8.6.0+2760+1746ec94ALSA-2025:1736
AlmaLinux8pgaudit1.5.0-1.module_el8.6.0+3095+ee60d910ALSA-2025:1736
AlmaLinux8pgaudit1.7.0-1.module_el8.9.0+3706+885c732eALSA-2025:1739
AlmaLinux8pgaudit16.0-1.module_el8.10.0+3798+606ebb9fALSA-2025:1740
21 more for AlmaLinux in the JSON.
Rocky Linux8libpq0:13.20-1.el8_10RLSA-2025:1737
Rocky Linux8pg_repack0:1.4.6-3.module+el8.10.0+1862+29bef648RLSA-2025:1736 RLSA-2025:3082
Rocky Linux8pg_repack0:1.4.6-3.module+el8.9.0+1594+4a6adae9RLSA-2025:3082
Rocky Linux8pg_repack0:1.4.6-3.module+el8.9.0+1603+444d1b54RLSA-2025:3082
Rocky Linux8pg_repack0:1.4.8-1.module+el8.10.0+1622+bd25b19cRLSA-2025:1739
Rocky Linux8pg_repack0:1.4.8-1.module+el8.10.0+1858+fcc46a79RLSA-2025:1739
Rocky Linux8pg_repack0:1.4.8-1.module+el8.9.0+1525+fc91df60RLSA-2025:1739
Rocky Linux8pg_repack0:1.5.1-1.module+el8.10.0+1900+d7340343RLSA-2025:1740
Rocky Linux8pgaudit0:1.4.0-7.module+el8.9.0+1735+a332307bRLSA-2025:3082
Rocky Linux8pgaudit0:1.5.0-1.module+el8.9.0+1594+4a6adae9RLSA-2025:1736
Rocky Linux8pgaudit0:1.7.0-1.module+el8.9.0+1525+fc91df60RLSA-2025:1739
Rocky Linux8pgaudit0:16.0-1.module+el8.10.0+1622+bd25b19cRLSA-2025:1740
22 more for Rocky Linux in the JSON.
Alpinev3.18, v3.19postgresql1313.20-r0ALPINE-CVE-2025-1094
Alpinev3.18, v3.19, v3.20postgresql1414.17-r0ALPINE-CVE-2025-1094
Alpinev3.18, v3.19, v3.20 and 2 morepostgresql1515.11-r0ALPINE-CVE-2025-1094
Alpinev3.19, v3.20, v3.21 and 3 morepostgresql1616.8-r0ALPINE-CVE-2025-1094
Alpinev3.21, v3.22, v3.23 and 1 morepostgresql1717.4-r0ALPINE-CVE-2025-1094
Azure Linux2postgresql14.16-1AZL-56791
Azure Linux3postgresql16.7-1AZL-56732
Alpaquita23postgresql1515.11-r0BELL-CVE-2025-1094
Alpaquitastreampostgresql1717.4-r0BELL-CVE-2025-1094

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; the Alpine secdb, CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine · Alpaquita.

Red Hat

Red Hat rates this Important.

Red Hat's statement

This vulnerability is marked as Important because it not only enables SQL injection but also allows arbitrary code execution (ACE) through PostgreSQL’s psql interactive tool. The flaw arises from improper neutralization of malformed UTF-8 sequences, which can bypass PostgreSQL’s escaping functions, leading to successful injection attacks. What elevates its severity is psql's support for meta-commands, specifically the ! command, which allows execution of arbitrary shell commands on the host system.

Even when untrusted input is correctly escaped (e.g., via pg_escape_string), an attacker can craft invalid UTF-8 characters containing raw bytes like 0x27 (a single quote), causing psql to misinterpret the SQL statement’s structure. This allows splitting a single query into multiple statements, enabling unauthenticated attackers to execute arbitrary SQL meta-commands (e.g., \! <OS command>) or inject malicious SQL.

Red Hat's mitigation

To 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 privileges: Limit OS-level permissions for the PostgreSQL user to reduce RCE impact.

4. Monitor logs: Flag repeated invalid byte sequence for encoding "UTF8" errors, which may indicate exploitation attempts.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 7 Extended Lifecycle Supportpostgresql-0:9.2.24-9.el7_9.3Fixed 2025-04-17RHSA-2025:3978
Red Hat Enterprise Linux 8postgresql:13-8100020250219110026.489197e6Fixed 2025-02-20RHSA-2025:1736
Red Hat Enterprise Linux 8libpq-0:13.20-1.el8_10Fixed 2025-02-20RHSA-2025:1737
Red Hat Enterprise Linux 8postgresql:15-8100020250218154242.489197e6Fixed 2025-02-20RHSA-2025:1739
Red Hat Enterprise Linux 8postgresql:16-8100020250218110357.489197e6Fixed 2025-02-20RHSA-2025:1740
Red Hat Enterprise Linux 8postgresql:12-8100020250319175311.489197e6Fixed 2025-03-20RHSA-2025:3082
Red Hat Enterprise Linux 8.2 Advanced Update Supportlibpq-0:12.7-1.el8_2.2Fixed 2025-02-20RHSA-2025:1720
Red Hat Enterprise Linux 8.2 Advanced Update Supportpostgresql:12-8020020250318123402.4cda2c84Fixed 2025-03-20RHSA-2025:3063
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Supportpostgresql:13-8040020250218192842.522a0ee4Fixed 2025-02-20RHSA-2025:1724
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Supportlibpq-0:13.20-1.el8_4Fixed 2025-02-20RHSA-2025:1735
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Supportpostgresql:12-8040020250318163425.522a0ee4Fixed 2025-03-20RHSA-2025:3062
Red Hat Enterprise Linux 8.4 Telecommunications Update Servicepostgresql:13-8040020250218192842.522a0ee4Fixed 2025-02-20RHSA-2025:1724
Red Hat Enterprise Linux 8.4 Telecommunications Update Servicelibpq-0:13.20-1.el8_4Fixed 2025-02-20RHSA-2025:1735
Red Hat Enterprise Linux 8.4 Telecommunications Update Servicepostgresql:12-8040020250318163425.522a0ee4Fixed 2025-03-20RHSA-2025:3062
Red Hat Enterprise Linux 8.4 Update Services for SAP Solutionspostgresql:13-8040020250218192842.522a0ee4Fixed 2025-02-20RHSA-2025:1724
Red Hat Enterprise Linux 8.4 Update Services for SAP Solutionslibpq-0:13.20-1.el8_4Fixed 2025-02-20RHSA-2025:1735
Red Hat Enterprise Linux 8.4 Update Services for SAP Solutionspostgresql:12-8040020250318163425.522a0ee4Fixed 2025-03-20RHSA-2025:3062
Red Hat Enterprise Linux 10libpqNot affected
Red Hat Enterprise Linux 10postgresql16Not affected
Red Hat Enterprise Linux 6postgresqlOut of support scope
26 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2025-1094.

Public exploits

GitHub PoC

Repositories on GitHub named after this CVE or listed for it by the PoC-in-GitHub index. For those marked Harbor Check: matches CVE, Flawharbor read the code and found it implements this CVE's exploitation technique: read, not run, and its dependencies only checked for warning signs, so a pointer and no guarantee. The rest are unverified: some hold a working proof of concept, some nothing useful, and some malware made to look like one. Read the code before you run any of it. How Harbor Check reads them, and what it found.

Detection rules

Ways to detect this CVE, not exploit code: the nuclei template that checks a system for it, and the Suricata and Snort rules that name it. A rule set may ship a rule turned off, so check yours by its sid.

  • Emerging Threats Open ET EXPLOIT PostgreSQL psql SQL Injection (CVE-2025-1094) sid 2060144

Attack patterns (CAPEC)

  • CAPEC-468 Generic Cross-Browser Cross-Domain Theft Severity: Medium

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON