CVE Vulnerabilities

CVE-2025-1094

Improper Neutralization of Quoting Syntax

Published: Feb 13, 2025 | Modified: Feb 21, 2025
CVSS 3.x
N/A
Source:
NVD
CVSS 2.x
RedHat/V2
RedHat/V3
8.1 IMPORTANT
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Ubuntu
MEDIUM

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.

Weakness

Quotes injected into a product can be used to compromise a system. As data are parsed, an injected/absent/duplicate/malformed use of quotes may cause the process to take unexpected actions.

Affected Software

Name Vendor Start Version End Version
Red Hat Enterprise Linux 8 RedHat postgresql:13-8100020250219110026.489197e6 *
Red Hat Enterprise Linux 8 RedHat libpq-0:13.20-1.el8_10 *
Red Hat Enterprise Linux 8 RedHat postgresql:15-8100020250218154242.489197e6 *
Red Hat Enterprise Linux 8 RedHat postgresql:16-8100020250218110357.489197e6 *
Red Hat Enterprise Linux 8 RedHat postgresql:12-8100020250319175311.489197e6 *
Red Hat Enterprise Linux 8.2 Advanced Update Support RedHat libpq-0:12.7-1.el8_2.2 *
Red Hat Enterprise Linux 8.2 Advanced Update Support RedHat postgresql:12-8020020250318123402.4cda2c84 *
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support RedHat postgresql:13-8040020250218192842.522a0ee4 *
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support RedHat libpq-0:13.20-1.el8_4 *
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update Support RedHat postgresql:12-8040020250318163425.522a0ee4 *
Red Hat Enterprise Linux 8.4 Telecommunications Update Service RedHat postgresql:13-8040020250218192842.522a0ee4 *
Red Hat Enterprise Linux 8.4 Telecommunications Update Service RedHat libpq-0:13.20-1.el8_4 *
Red Hat Enterprise Linux 8.4 Telecommunications Update Service RedHat postgresql:12-8040020250318163425.522a0ee4 *
Red Hat Enterprise Linux 8.4 Update Services for SAP Solutions RedHat postgresql:13-8040020250218192842.522a0ee4 *
Red Hat Enterprise Linux 8.4 Update Services for SAP Solutions RedHat libpq-0:13.20-1.el8_4 *
Red Hat Enterprise Linux 8.4 Update Services for SAP Solutions RedHat postgresql:12-8040020250318163425.522a0ee4 *
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support RedHat postgresql:13-8060020250218173011.ad008a3a *
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support RedHat libpq-0:13.20-1.el8_6 *
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Support RedHat postgresql:12-8060020250318121325.ad008a3a *
Red Hat Enterprise Linux 8.6 Telecommunications Update Service RedHat postgresql:13-8060020250218173011.ad008a3a *
Red Hat Enterprise Linux 8.6 Telecommunications Update Service RedHat libpq-0:13.20-1.el8_6 *
Red Hat Enterprise Linux 8.6 Telecommunications Update Service RedHat postgresql:12-8060020250318121325.ad008a3a *
Red Hat Enterprise Linux 8.6 Update Services for SAP Solutions RedHat postgresql:13-8060020250218173011.ad008a3a *
Red Hat Enterprise Linux 8.6 Update Services for SAP Solutions RedHat libpq-0:13.20-1.el8_6 *
Red Hat Enterprise Linux 8.6 Update Services for SAP Solutions RedHat postgresql:12-8060020250318121325.ad008a3a *
Red Hat Enterprise Linux 8.8 Extended Update Support RedHat postgresql:15-8080020250218151741.63b34585 *
Red Hat Enterprise Linux 8.8 Extended Update Support RedHat postgresql:13-8080020250218141334.63b34585 *
Red Hat Enterprise Linux 8.8 Extended Update Support RedHat libpq-0:13.20-1.el8_8 *
Red Hat Enterprise Linux 8.8 Extended Update Support RedHat postgresql:12-8080020250318115906.63b34585 *
Red Hat Enterprise Linux 9 RedHat libpq-0:13.20-1.el9_5 *
Red Hat Enterprise Linux 9 RedHat postgresql:15-9050020250218090615.rhel9 *
Red Hat Enterprise Linux 9 RedHat postgresql-0:13.20-1.el9_5 *
Red Hat Enterprise Linux 9 RedHat postgresql:16-9050020250218075302.rhel9 *
Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions RedHat libpq-0:13.20-1.el9_0 *
Red Hat Enterprise Linux 9.0 Update Services for SAP Solutions RedHat postgresql-0:13.20-1.el9_0 *
Red Hat Enterprise Linux 9.2 Extended Update Support RedHat postgresql:15-9020020250218153429.rhel9 *
Red Hat Enterprise Linux 9.2 Extended Update Support RedHat postgresql-0:13.20-1.el9_2 *
Red Hat Enterprise Linux 9.2 Extended Update Support RedHat libpq-0:13.20-1.el9_2 *
Red Hat Enterprise Linux 9.4 Extended Update Support RedHat postgresql-0:13.20-1.el9_4 *
Red Hat Enterprise Linux 9.4 Extended Update Support RedHat postgresql:15-9040020250218181918.rhel9 *
Red Hat Enterprise Linux 9.4 Extended Update Support RedHat postgresql:16-9040020250218200209.rhel9 *
Red Hat Enterprise Linux 9.4 Extended Update Support RedHat libpq-0:13.20-1.el9_4 *
Postgresql-12 Ubuntu focal *
Postgresql-14 Ubuntu jammy *
Postgresql-14 Ubuntu upstream *
Postgresql-16 Ubuntu noble *
Postgresql-16 Ubuntu oracular *
Postgresql-16 Ubuntu upstream *
Postgresql-17 Ubuntu upstream *

Potential Mitigations

  • Assume all input is malicious. Use an “accept known good” input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
  • When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, “boat” may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as “red” or “blue.”
  • Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code’s environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.

References