[CLSA-2026:1791453653] alt-php55: Fix of CVE-2025-1218
Type:
security
Severity:
Important
Release date:
2026-10-08 10:01:07 UTC
Description:
- CVE-2025-1218: various packet over-reads in the mysqlnd wire protocol. The packet readers decoded fields out of a server response before checking that the packet still held the bytes for them, so a malicious or compromised MySQL server could make the client read past the end of the packet buffer with a truncated packet. BAIL_IF_NO_MORE_DATA, which only noticed an over-read after it had happened, is replaced by BAIL_IF_NOT_ENOUGH_DATA_EX(n), which checks before the read; php_mysqlnd_net_field_length() and its _ll variant now take the number of bytes left and refuse to decode a length whose payload is not fully present; the auth-plugin-name branches in auth_response_read, chg_user_read and cached_sha2_result_read use memchr() instead of trusting a NUL terminator (the latter two read into buffers nothing zero-terminates); the greeting's server version string is read the same way; and the TIME, DATE and DATETIME readers stop decoding fixed offsets out of a shorter declared length (GHSA-r6x9-5r99-36j7, upstream 114dbb7436). - The mysqlnd_ps.c hunk is a leak fix, not a memory-safety one: it releases the connection reference and the execute command buffer before mysqlnd_stmt_prepare_read_eof() memsets the statement, a path that only becomes reachable now that a short EOF packet is rejected. The prepare_read and sha256_pk_request_response_read changes are hardening rather than memory safety - prepare_read's new byte counts provably cannot fire behind the PREPARE_RESPONSE_SIZE gate in front of them, and the sha256 one is a strictness change. - Not applicable on 5.5: MARIADB_RPL_VERSION_HACK does not exist here, and upstream's two-byte look-ahead in cached_sha2_result_read guards a packet->result read that this branch's caching_sha2_password backport never added (the one-byte read it does have is guarded instead). The ps_codec helper trio and the text-row packet_end guard came in with our CVE-2024-8929 backport, so this patch extends them. As a prerequisite the bounded form of the greeting's auth plugin name from php-8.1.34 is carried too, without which dropping the NUL-terminating hack would make that estrdup() an unbounded read off a 2048 byte stack buffer. - Upstream's 38 phpt tests are not carried: they need the PHP 8 fake_server.inc, and the RPM test suite runs in the build-cgi tree, which is built without mysqli/mysqlnd, so every ext/mysqli test skips there. - The same mysqlnd_ps.c hunk also corrects that path's result free from mnd_efree() to upstream's php-7.0 form, mnd_pefree(stmt->result, stmt->result->persistent): mysqlnd_result_init() allocates the result with mnd_pecalloc(..., persistent), so on a persistent connection the Zend allocator was being handed a malloc()ed block. Before the change a hostile prepare over p:127.0.0.1 aborts with "zend_mm_heap corrupted" on a build with the Zend MM heap checks compiled in; after it the same run completes, and a non-persistent connection is unaffected either way - Also fixes a pre-existing use-after-free on the row-reader failure path: the CVE-2024-8929 error loops free every field decoded so far without clearing the zvals, and the result set frees them again at teardown. All 2 sites now clear after freeing. Confirmed under AddressSanitizer with the Zend allocator disabled - heap-use-after-free before, clean after, on the three new short-length tests and the nine CVE-2024-8929 stmt-row tests. Upstream still carries the same loops unguarded in php-8.2.34 through php-8.5.11 - mysqlnd: initialise every pre-allocated row field before decoding (php-5.5.38-mysqlnd-rowp-init-fields.patch). The row readers pre-allocate a zval per column with MAKE_STD_ZVAL(), which sets no type, and only type it when the decode loop reaches that column; the CVE-2024-8929 error paths abandon a row part-way, leaving the rest allocated but never typed, and the result set still frees the whole row at teardown. Each column is now ZVAL_NULL()ed at allocation. Verified with valgrind under USE_ZEND_ALLOC=0. PHP 5 only, and kept separate from the CVE patch because the defect predates it and is reachable without it
CVEs fixed:
Updated packages:
  • alt-php55-5.5.38-182.el8.x86_64.rpm
    sha:522235303cec5c19c23a107e8263af0b2bed5e3a23c3a239e3908ca66d92219f
  • alt-php55-bcmath-5.5.38-182.el8.x86_64.rpm
    sha:5084745592f20b4f19f0da17b7a17599ad0254849de25c51537ae6620191744d
  • alt-php55-cli-5.5.38-182.el8.x86_64.rpm
    sha:b9ccafaf907a0fb3995cfea8c034db71b81858b97342f1b29a255b7bbaa5f12f
  • alt-php55-common-5.5.38-182.el8.x86_64.rpm
    sha:b9d08cea58d84de9c7028456cde7dbef035ea28504e15e6cd48ecc642155c25c
  • alt-php55-dba-5.5.38-182.el8.x86_64.rpm
    sha:34d620e2d7a69d0f08a5f91310686e48f9cb771d9bdf8c5cdf34a3c21781adef
  • alt-php55-dbx-5.5.38-182.el8.x86_64.rpm
    sha:51fc5e441c07bab302c355391dbf564b52ea87829b4cccbc1c3d01538e9b16d2
  • alt-php55-devel-5.5.38-182.el8.x86_64.rpm
    sha:4a0d48b56c5e3ab5379bdff5d0828d24490c1a1dfb0664700aa63b76c3f2e26a
  • alt-php55-enchant-5.5.38-182.el8.x86_64.rpm
    sha:894826315dfcfe3fca8790c384e10f6f184f4a6a4ca4e674a7e45c6cd46b6d31
  • alt-php55-firebird-5.5.38-182.el8.x86_64.rpm
    sha:ff5b331f81b262213f1db6f7bf948935f57126d258fcfca78785cabcd59b1af2
  • alt-php55-gd-5.5.38-182.el8.x86_64.rpm
    sha:f54110389aeb496f80b5da5421ab638ac2203389cb9b5e1c8782d85eed110f8a
  • alt-php55-imap-5.5.38-182.el8.x86_64.rpm
    sha:d2dfb60a864df11ddc213a7ad4432b340608d19fa92936bd58eec8d546038137
  • alt-php55-intl-5.5.38-182.el8.x86_64.rpm
    sha:c19cbfe4977b052aa6106f4d2471d7362bed6fb0410c8e9f00d2268d58780875
  • alt-php55-ldap-5.5.38-182.el8.x86_64.rpm
    sha:943e4242587ebe9ef0ea3162a8f1def9409b5b42a5a61a036df9600a07a0794e
  • alt-php55-mbstring-5.5.38-182.el8.x86_64.rpm
    sha:71cc9a93a46160600f8f778a3c96443411bf1f3a6cf142869b684e8c3b5d7a65
  • alt-php55-mcrypt-5.5.38-182.el8.x86_64.rpm
    sha:2f78b0a1189d4c2cedb454a4bc0eae277270c1778519b3c31181d25db70ff159
  • alt-php55-mssql-5.5.38-182.el8.x86_64.rpm
    sha:fdcda065224a5e63e9de8d8cdd062790c7ddaf8a9ff2f40aaf757bf097193d9f
  • alt-php55-mysqlnd-5.5.38-182.el8.x86_64.rpm
    sha:0081860fc292c9a306edb889ae9ea72bc9fb31fe7b8460e288d74c5a24ab793a
  • alt-php55-odbc-5.5.38-182.el8.x86_64.rpm
    sha:a4345b83ff786cee6a1915732c2620fd2323ca160fcd3627220db0c9cd79a79b
  • alt-php55-opcache-5.5.38-182.el8.x86_64.rpm
    sha:200a45f62bc8a66dd841423e93c75defed3651d06d7356c260d18ca6aaac4a89
  • alt-php55-pdo-5.5.38-182.el8.x86_64.rpm
    sha:9badd0e93828aeea08b2e748e60b5571bf6c269868f9bf457582de967c1e572a
  • alt-php55-pgsql-5.5.38-182.el8.x86_64.rpm
    sha:c8e45be93328949adfce55203d36d39d6575b9bd4a4ede88642473bf94396534
  • alt-php55-php-fpm-5.5.38-182.el8.x86_64.rpm
    sha:9cdb36259ced91d127cf6f6f2ca94ed1f1c605dc25dff318e6526e12468a720e
  • alt-php55-process-5.5.38-182.el8.x86_64.rpm
    sha:befba7178be6e585c28c0683ad181ce6e15b777cafc5ec22dbbb84d2c80ce416
  • alt-php55-pspell-5.5.38-182.el8.x86_64.rpm
    sha:cdf914b2b5cf088a6e73bd6f98330fb2c7e09966e6a20e957f65fbbaa21c099e
  • alt-php55-recode-5.5.38-182.el8.x86_64.rpm
    sha:fcf2cfc4c7438bdd7ffd6e016a879506dd1833ef11e7eb5051ec277a3c80fe89
  • alt-php55-snmp-5.5.38-182.el8.x86_64.rpm
    sha:d1ede3a33e42b9272bda6ebfef619610c096f2992749cf7f0b52b6c0a9375a84
  • alt-php55-soap-5.5.38-182.el8.x86_64.rpm
    sha:f3d3ee7eefb30739681a46b7448f1028569397722d805514934281d33cea000f
  • alt-php55-sybase-5.5.38-182.el8.x86_64.rpm
    sha:9f7514ee6c44b305ca1bbf8a33e9dd1cbaf3cea876224915916726b5c65cc7a9
  • alt-php55-tidy-5.5.38-182.el8.x86_64.rpm
    sha:60ecd3086b4b7ed2cafa0df445c99163fbec41da69e794120283dee08ffdde68
  • alt-php55-xml-5.5.38-182.el8.x86_64.rpm
    sha:fc52ffee1800b408126d3f7aa88991c9abea748c33e38304e55ff41f8a89ed5d
  • alt-php55-xmlrpc-5.5.38-182.el8.x86_64.rpm
    sha:0164fdd3422000cedfb3b1d42479158b04a92e1753049d79c6ada5de19c9e8d0
Notes:
This page is generated automatically and has not been checked for errors. For clarification or corrections please contact the CloudLinux Packaging Team.