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
root.io logo minimus.io logo echo.ai logo

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

NameVendorStart VersionEnd Version
Red Hat Enterprise Linux 7 Extended Lifecycle SupportRedHatpostgresql-0:9.2.24-9.el7_9.3*
Red Hat Enterprise Linux 8RedHatpostgresql:13-8100020250219110026.489197e6*
Red Hat Enterprise Linux 8RedHatlibpq-0:13.20-1.el8_10*
Red Hat Enterprise Linux 8RedHatpostgresql:15-8100020250218154242.489197e6*
Red Hat Enterprise Linux 8RedHatpostgresql:16-8100020250218110357.489197e6*
Red Hat Enterprise Linux 8RedHatpostgresql:12-8100020250319175311.489197e6*
Red Hat Enterprise Linux 8.2 Advanced Update SupportRedHatlibpq-0:12.7-1.el8_2.2*
Red Hat Enterprise Linux 8.2 Advanced Update SupportRedHatpostgresql:12-8020020250318123402.4cda2c84*
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update SupportRedHatpostgresql:13-8040020250218192842.522a0ee4*
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update SupportRedHatlibpq-0:13.20-1.el8_4*
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update SupportRedHatpostgresql:12-8040020250318163425.522a0ee4*
Red Hat Enterprise Linux 8.4 Telecommunications Update ServiceRedHatpostgresql:13-8040020250218192842.522a0ee4*
Red Hat Enterprise Linux 8.4 Telecommunications Update ServiceRedHatlibpq-0:13.20-1.el8_4*
Red Hat Enterprise Linux 8.4 Telecommunications Update ServiceRedHatpostgresql:12-8040020250318163425.522a0ee4*
Red Hat Enterprise Linux 8.4 Update Services for SAP SolutionsRedHatpostgresql:13-8040020250218192842.522a0ee4*
Red Hat Enterprise Linux 8.4 Update Services for SAP SolutionsRedHatlibpq-0:13.20-1.el8_4*
Red Hat Enterprise Linux 8.4 Update Services for SAP SolutionsRedHatpostgresql:12-8040020250318163425.522a0ee4*
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update SupportRedHatpostgresql:13-8060020250218173011.ad008a3a*
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update SupportRedHatlibpq-0:13.20-1.el8_6*
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update SupportRedHatpostgresql:12-8060020250318121325.ad008a3a*
Red Hat Enterprise Linux 8.6 Telecommunications Update ServiceRedHatpostgresql:13-8060020250218173011.ad008a3a*
Red Hat Enterprise Linux 8.6 Telecommunications Update ServiceRedHatlibpq-0:13.20-1.el8_6*
Red Hat Enterprise Linux 8.6 Telecommunications Update ServiceRedHatpostgresql:12-8060020250318121325.ad008a3a*
Red Hat Enterprise Linux 8.6 Update Services for SAP SolutionsRedHatpostgresql:13-8060020250218173011.ad008a3a*
Red Hat Enterprise Linux 8.6 Update Services for SAP SolutionsRedHatlibpq-0:13.20-1.el8_6*
Red Hat Enterprise Linux 8.6 Update Services for SAP SolutionsRedHatpostgresql:12-8060020250318121325.ad008a3a*
Red Hat Enterprise Linux 8.8 Extended Update SupportRedHatpostgresql:15-8080020250218151741.63b34585*
Red Hat Enterprise Linux 8.8 Extended Update SupportRedHatpostgresql:13-8080020250218141334.63b34585*
Red Hat Enterprise Linux 8.8 Extended Update SupportRedHatlibpq-0:13.20-1.el8_8*
Red Hat Enterprise Linux 8.8 Extended Update SupportRedHatpostgresql:12-8080020250318115906.63b34585*
Red Hat Enterprise Linux 9RedHatlibpq-0:13.20-1.el9_5*
Red Hat Enterprise Linux 9RedHatpostgresql:15-9050020250218090615.rhel9*
Red Hat Enterprise Linux 9RedHatpostgresql-0:13.20-1.el9_5*
Red Hat Enterprise Linux 9RedHatpostgresql:16-9050020250218075302.rhel9*
Red Hat Enterprise Linux 9.0 Update Services for SAP SolutionsRedHatlibpq-0:13.20-1.el9_0*
Red Hat Enterprise Linux 9.0 Update Services for SAP SolutionsRedHatpostgresql-0:13.20-1.el9_0*
Red Hat Enterprise Linux 9.2 Extended Update SupportRedHatpostgresql:15-9020020250218153429.rhel9*
Red Hat Enterprise Linux 9.2 Extended Update SupportRedHatpostgresql-0:13.20-1.el9_2*
Red Hat Enterprise Linux 9.2 Extended Update SupportRedHatlibpq-0:13.20-1.el9_2*
Red Hat Enterprise Linux 9.4 Extended Update SupportRedHatpostgresql-0:13.20-1.el9_4*
Red Hat Enterprise Linux 9.4 Extended Update SupportRedHatpostgresql:15-9040020250218181918.rhel9*
Red Hat Enterprise Linux 9.4 Extended Update SupportRedHatpostgresql:16-9040020250218200209.rhel9*
Red Hat Enterprise Linux 9.4 Extended Update SupportRedHatlibpq-0:13.20-1.el9_4*
Postgresql-10Ubuntuesm-infra/bionic*
Postgresql-10Ubuntuupstream*
Postgresql-12Ubuntuesm-infra/focal*
Postgresql-12Ubuntufocal*
Postgresql-12Ubuntuupstream*
Postgresql-14Ubuntujammy*
Postgresql-14Ubuntuupstream*
Postgresql-16Ubuntunoble*
Postgresql-16Ubuntuoracular*
Postgresql-16Ubuntuupstream*
Postgresql-17Ubuntuupstream*
Postgresql-9.3Ubuntuupstream*
Postgresql-9.5Ubuntuupstream*

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