REDHAT-BUG-2378689: SQL Injection
Missing error checking could result in SQL injection and missing error handling could lead to crashes due to null pointer dereferences.
This is related to https://www.postgresql.org/support/security/CVE-2025-1094/ that was reported to postgres. The reporter used php to showcase the problem.
While working on addressing the report, it was realised that PHP uses the escape functions in a way that does not allow for errors to be reported. Specifically the error parameters is not passed to PQescapeStringConn(), which therefore cannot report an error.
While postgres now tries to make sure that the escaped string will trigger errors on the server-side if the string is invalidly encoded, that still can be insufficient, depending on how the escaped values are used.
It was also noted that several calls to PQescapeIdentifier() do not check for the returned value being NULL, despite that being the documented way that PQescapeIdentifier() (and PQescapeLiteral()) to report errors. Seems like that could cause crashes or at least UB in some of the callsites.
Affected Software
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-2378689?
The severity of REDHAT-BUG-2378689 is high due to its potential for SQL injection and application crashes.
How do I fix REDHAT-BUG-2378689?
To fix REDHAT-BUG-2378689, ensure you have the latest updates applied to PostgreSQL and PHP that address the vulnerability.
What systems are affected by REDHAT-BUG-2378689?
REDHAT-BUG-2378689 affects systems running PostgreSQL and PHP without the necessary error handling and checks.
What attacks can exploit REDHAT-BUG-2378689?
Attackers can exploit REDHAT-BUG-2378689 via SQL injection attacks or by causing application crashes through null pointer dereference.
How can I check if I am vulnerable to REDHAT-BUG-2378689?
You can check for vulnerability to REDHAT-BUG-2378689 by reviewing your PostgreSQL and PHP versions against the latest security advisories.