Release date:
2026-09-01 13:30:25 UTC
Description:
* SECURITY UPDATE: ext/pgsql and ext/pdo_pgsql ignored the error status of
the libpq escaping helpers
- debian/patches/php-5.6-CVE-2025-1735.patch: backport upstream commit
9376aeef9f8ff81f2705b8016237ec3e30bdee44 (GHSA-hrwm-9436-5mv3) in
ext/pgsql/pgsql.c and ext/pdo_pgsql/pgsql_driver.c.
Every PQescapeStringConn() call passed NULL for the "error"
out-parameter and the pointers returned by PQescapeByteaConn() and
PQescapeIdentifier() were used without a NULL check. libpq refuses to
escape input that is not valid in the connection's client encoding -
the PostgreSQL CVE-2025-1094 case - setting its error flag and leaving
a mangled buffer behind, which PHP then used to build a query, so the
caller had no way to learn the value was never escaped. The unchecked
PQescapeIdentifier() returns are a NULL dereference: strlen(NULL) via
smart_str_appends() in build_tablename(), memcpy() from NULL in the PDO
quoter. Call sites covered: pg_escape_string(), pg_escape_bytea(),
php_pgsql_meta_data(), php_pgsql_convert() (string, bytea and
identifier paths), build_tablename(), php_pgsql_insert(),
build_assignment_string() and pgsql_handle_quoter().
Confirmed on PostgreSQL 15.19 with a locally built 5.6.40: for the
input "\xC3' OR 1=1 --" an unpatched pg_escape_string() returned
"\xC0 '' OR 1=1 --" with no error of any kind, and pg_convert(),
pg_insert() and PDO::quote() emitted that same mangled value into the
generated SQL; with this patch all four report the failure and return
false, while valid input is byte-identical to before.
- Note: hand-ported to the PHP 5 zval API from the alt-php70 adaptation
(Gerrit 269508) - 13 of the upstream commit's 22 hunks target the
zend_string / zend_result / ZPP-exception APIs PHP 5 does not have.
build_tablename() gains TSRMLS_DC and an int (SUCCESS/FAILURE) return,
php_pgsql_convert() escapes into a local buffer and only populates the
result zval once the escape succeeded so the existing error cleanup
stays safe, php_pgsql_insert() fetches the current hash key so the
diagnostic can name the field, and every error flag is initialised to 0
so the added checks cannot read uninitialised memory in the
!HAVE_PQESCAPE_CONN build where PQescapeStringConn() is a macro that
discards the error argument.
- Adds ext/pgsql/tests/ghsa-hrwm-9436-5mv3.phpt, a PHP 5.6 replacement for
the two upstream .phpt files, which rely on PHP 8 exception semantics.
Like every other test in ext/pgsql/tests it skips unless
PGSQL_TEST_CONNSTR points at a live server. ext/pgsql plus
ext/pdo_pgsql: 140 passed and the same 3 pre-existing failures
(bug48764, bug_33876, bug81720) before and after the patch.
- CVE-2025-1735
Updated packages:
-
alt-php56_5.6.40-140_amd64.deb
sha:536ed308cba063e7d31392f1cc42c80bdbc84db9
-
alt-php56-bcmath_5.6.40-140_amd64.deb
sha:67501971fa269d69699bc7a653661d0159d4f6e5
-
alt-php56-cli_5.6.40-140_amd64.deb
sha:c70963233eb2f0b866e4104aba972c90aaa91f76
-
alt-php56-common_5.6.40-140_amd64.deb
sha:50269c76bd3ef2ca3a1c6b643a22b5bf89fc1051
-
alt-php56-dba_5.6.40-140_amd64.deb
sha:40ae86aead984c73ea9a3c72c5b3618a89505aa4
-
alt-php56-dbx_5.6.40-140_amd64.deb
sha:2fa56cd2fdfafbf2990a03aeb59a0af649c6774d
-
alt-php56-dev_5.6.40-140_amd64.deb
sha:6697376ac7528f0fc15649e6787cd6bb554c5eb3
-
alt-php56-enchant_5.6.40-140_amd64.deb
sha:6e7dd34472f86a4d12b8259a715f554cf1c09168
-
alt-php56-firebird_5.6.40-140_amd64.deb
sha:b98a04ca3cb49b3a32a18e08b8844b08836f2dc3
-
alt-php56-gd_5.6.40-140_amd64.deb
sha:13772112fe91318545054bec89a3197811278d73
-
alt-php56-imap_5.6.40-140_amd64.deb
sha:a5e2a9b3cf006c7401640599265fb415e67e4673
-
alt-php56-intl_5.6.40-140_amd64.deb
sha:a7cc29886805c0e296b5f4d9cb441db67087b0a3
-
alt-php56-ldap_5.6.40-140_amd64.deb
sha:15c67037db36a27d0353164657deb7f3394937fa
-
alt-php56-mbstring_5.6.40-140_amd64.deb
sha:42b2c8f1f277979bbebe0ecd1d1428706328b09b
-
alt-php56-mcrypt_5.6.40-140_amd64.deb
sha:47e13cda2820ecd1bca6cd6ca17ff8f2b1e23673
-
alt-php56-mysqlnd_5.6.40-140_amd64.deb
sha:728bc3f8e7787395ada367fe12a264181cbe82da
-
alt-php56-odbc_5.6.40-140_amd64.deb
sha:ffb9545ca74a79846d52c9a5ec32f464f8a76a26
-
alt-php56-opcache_5.6.40-140_amd64.deb
sha:07d325748bc299e0057b751075eaabd35dfbbd07
-
alt-php56-pdo_5.6.40-140_amd64.deb
sha:f02dff4b480fb46bc7bf71066580e139e8a06b06
-
alt-php56-pgsql_5.6.40-140_amd64.deb
sha:f75465d01c40782c2f35992c844ddab08d1213c0
-
alt-php56-php-fpm_5.6.40-140_amd64.deb
sha:8660055fe5c127fb44038a928f14b99a04cae3f7
-
alt-php56-process_5.6.40-140_amd64.deb
sha:51661d1e3df40fd68537bd7fffdafd1c47569195
-
alt-php56-pspell_5.6.40-140_amd64.deb
sha:021ef35f6f6b6d5a1ee325bedd72c2e39b7c8889
-
alt-php56-recode_5.6.40-140_amd64.deb
sha:2df73e2e69d396aea3fe265b8e08baf1a1de4402
-
alt-php56-snmp_5.6.40-140_amd64.deb
sha:172e6670251a319ee52f5b8cad4dc14019aa06f3
-
alt-php56-soap_5.6.40-140_amd64.deb
sha:108d493e38809ab031a5857894b0cbfcbc033d5d
-
alt-php56-sybase_5.6.40-140_amd64.deb
sha:168237c66b04ea411a31ed29a0b629b8c8af23c0
-
alt-php56-tidy_5.6.40-140_amd64.deb
sha:d1536a42ae95e36bb8163a8153527d5bed352a96
-
alt-php56-xml_5.6.40-140_amd64.deb
sha:cb21bb811bc08a9025578ae9bfa4c950e5955487
-
alt-php56-xmlrpc_5.6.40-140_amd64.deb
sha:45303088380e9c1faa49a25ef5de8f63553480d0
Notes:
This page is generated automatically and has not been checked for errors. For clarification or
corrections please contact the
CloudLinux Packaging Team.