Release date:
2026-09-23 12:43:19 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:371fa7576dc3e583e18103e9b399448d15ed7a71
-
alt-php56-bcmath_5.6.40-140_amd64.deb
sha:2d61d6b457458fdcada1fbf8e33c376684e47407
-
alt-php56-cli_5.6.40-140_amd64.deb
sha:fe470e81c719dab248953c416f3b18e795403f45
-
alt-php56-common_5.6.40-140_amd64.deb
sha:39b13cde8bd9aca539ea36c390be42c33f26c27f
-
alt-php56-dba_5.6.40-140_amd64.deb
sha:a881765a91e2567cb302ea2a935b77928b491ddc
-
alt-php56-dbx_5.6.40-140_amd64.deb
sha:f3778635f5e5183c4ce4a310d31cb413ff5c84e9
-
alt-php56-dev_5.6.40-140_amd64.deb
sha:99e7917aefc4476effd673429454c56589f81044
-
alt-php56-enchant_5.6.40-140_amd64.deb
sha:09bf4185f90b56050c8ee5e253134fbd6edae62d
-
alt-php56-firebird_5.6.40-140_amd64.deb
sha:d7eeed0bd81898a92e7f91bc3de5016a64a4f5fc
-
alt-php56-gd_5.6.40-140_amd64.deb
sha:4e1f457ebce2b6ab9cd960abfcc1d47a01bfc255
-
alt-php56-imap_5.6.40-140_amd64.deb
sha:c8755ea58c83f7bd37a443dc1fea7a764b6715ea
-
alt-php56-intl_5.6.40-140_amd64.deb
sha:9eec8882fad58ea390433279226edcfc9aa9e50e
-
alt-php56-ldap_5.6.40-140_amd64.deb
sha:763c3bd0184c1508e1454eb01d4231d8401ac57e
-
alt-php56-mbstring_5.6.40-140_amd64.deb
sha:33b7bdc3e3ddb95ea940375ce7c6fffa6c7e70ca
-
alt-php56-mcrypt_5.6.40-140_amd64.deb
sha:25a362980efb90f35a401a7aa4f901e1aa61fe73
-
alt-php56-mysqlnd_5.6.40-140_amd64.deb
sha:b7c5c3b554f629bd52485fc5020b9dbd24b6c45f
-
alt-php56-odbc_5.6.40-140_amd64.deb
sha:9c654cd48311097c3083dd0acb5e326c24a03154
-
alt-php56-opcache_5.6.40-140_amd64.deb
sha:9af2c3e2d38ef2a194b1add9ee4f5403675ee13c
-
alt-php56-pdo_5.6.40-140_amd64.deb
sha:aa796fd8886a1545da1d2c1b5ef7cc812a35ec68
-
alt-php56-pgsql_5.6.40-140_amd64.deb
sha:152dbd29a6bcc300e52872668314197b1084f7b6
-
alt-php56-php-fpm_5.6.40-140_amd64.deb
sha:02938e3bdd0e1097c80222c57097d9dd71ed1ce0
-
alt-php56-process_5.6.40-140_amd64.deb
sha:d1c28aa841c3cfb5a3005582297167b28e52710b
-
alt-php56-pspell_5.6.40-140_amd64.deb
sha:89b0f80d0bcde6864d043a66c8af63628cdea037
-
alt-php56-recode_5.6.40-140_amd64.deb
sha:c313ab6f19375988db33d39dc154c5d70f7c8ce6
-
alt-php56-snmp_5.6.40-140_amd64.deb
sha:f8881ee02f55ada791826663f7792dc7cff3da2f
-
alt-php56-soap_5.6.40-140_amd64.deb
sha:6b5c87274d742e4b4b366ddf4fd7a6df57da6b69
-
alt-php56-sybase_5.6.40-140_amd64.deb
sha:fd334b7739ace7f10ab198a277ed325fe8d9f8e4
-
alt-php56-tidy_5.6.40-140_amd64.deb
sha:98496bada82f0e0621669dcaf9f2a0e50ef3280b
-
alt-php56-xml_5.6.40-140_amd64.deb
sha:20a27eedd403ef4c67c7f428bffedd98560719ca
-
alt-php56-xmlrpc_5.6.40-140_amd64.deb
sha:b5c5fd2ab987870c2a6c44931ecb95b3b46932ff
Notes:
This page is generated automatically and has not been checked for errors. For clarification or
corrections please contact the
CloudLinux Packaging Team.