[CLSA-2026:1790164825] Fix CVE(s): CVE-2014-3622
Type:
security
Severity:
Important
Release date:
2026-09-23 13:53:26 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
CVEs fixed:
Updated packages:
  • alt-php56_5.6.40-140_amd64.deb
    sha:c7ccc59c41d2f778597017a46c807fef1ee95052
  • alt-php56-bcmath_5.6.40-140_amd64.deb
    sha:6a1c2d26c8b4f864d36328371111086f5f08472d
  • alt-php56-cli_5.6.40-140_amd64.deb
    sha:9cfc59f3d93c48ed878f2f835ed9ee0480009e8e
  • alt-php56-common_5.6.40-140_amd64.deb
    sha:03b83df763f7d84f5cf306b3b3d56f1a32e14091
  • alt-php56-dba_5.6.40-140_amd64.deb
    sha:63ffae11ff4c1478754100fd21bc05b44343f120
  • alt-php56-dbx_5.6.40-140_amd64.deb
    sha:2f00d2dcd4a039e6885c009db281b95eb8f03ca4
  • alt-php56-dev_5.6.40-140_amd64.deb
    sha:75a28f36cce6ae94b59002333463e8a381d5f344
  • alt-php56-enchant_5.6.40-140_amd64.deb
    sha:6b65bbce58bf28f6c5a692ceb1a36e194201dd74
  • alt-php56-firebird_5.6.40-140_amd64.deb
    sha:215e5c2db72b3d0fc05c3335d3dc4b5dcbcbbc0c
  • alt-php56-gd_5.6.40-140_amd64.deb
    sha:cf8d0f3d1c586f9ba311e25a262a2cf87e722efa
  • alt-php56-imap_5.6.40-140_amd64.deb
    sha:56b2b3741b2662827b8bddc53933832ea5c393d6
  • alt-php56-intl_5.6.40-140_amd64.deb
    sha:fa51a6f5867c350d9e7dfee664b8457f8c1dff82
  • alt-php56-ldap_5.6.40-140_amd64.deb
    sha:2353bc30657ff9cc7fa3be0b5cc486ad6a3dcd6b
  • alt-php56-mbstring_5.6.40-140_amd64.deb
    sha:46a269de5cb48ebd8f6e7adab8881f2995e97200
  • alt-php56-mcrypt_5.6.40-140_amd64.deb
    sha:c21f0cb5a0f71be61ab4c34d9f454f3705a25456
  • alt-php56-mysqlnd_5.6.40-140_amd64.deb
    sha:da0e85e53900efa35230aed52f6f48cdb6104d36
  • alt-php56-odbc_5.6.40-140_amd64.deb
    sha:bc00e4994d2d858a87c9d84c9a7a15031f428963
  • alt-php56-opcache_5.6.40-140_amd64.deb
    sha:6dbd80815ea06a04d910229e9e0c0a4e325f8c6d
  • alt-php56-pdo_5.6.40-140_amd64.deb
    sha:2ea6d19d8d46cf15556f44a0ac7981b249348cf3
  • alt-php56-pgsql_5.6.40-140_amd64.deb
    sha:a28899385374b3f8dabdfa04cf89beceb1cacbf6
  • alt-php56-php-fpm_5.6.40-140_amd64.deb
    sha:5f84f62607d57f2515705731d1e7ad758efc1d8a
  • alt-php56-process_5.6.40-140_amd64.deb
    sha:ec7ab7aafe94a73e408621377e318ae097e93a62
  • alt-php56-pspell_5.6.40-140_amd64.deb
    sha:9495e15c90f071ed34d88e3545c877db5639be5c
  • alt-php56-recode_5.6.40-140_amd64.deb
    sha:262d04234f9a8fb3168e04a79620fb878b644303
  • alt-php56-snmp_5.6.40-140_amd64.deb
    sha:d73cc41fc8a338efb7f8d3b340fc229eedbf2e58
  • alt-php56-soap_5.6.40-140_amd64.deb
    sha:525d07cda689dee8965cb20f806a793cecafc741
  • alt-php56-sybase_5.6.40-140_amd64.deb
    sha:0d37a3f38f6f837b9d03de6935208e679b90e642
  • alt-php56-tidy_5.6.40-140_amd64.deb
    sha:e5e12feda7283f1b853dada3a486d135352e5705
  • alt-php56-xml_5.6.40-140_amd64.deb
    sha:6b4130b5ffb34590db210d9921332675eccedcf7
  • alt-php56-xmlrpc_5.6.40-140_amd64.deb
    sha:75384703c2b420a688b62d3d5259b325a5f84a90
Notes:
This page is generated automatically and has not been checked for errors. For clarification or corrections please contact the CloudLinux Packaging Team.