[CLSA-2026:1791553939] alt-php55: Fix of CVE-2025-1218
Type:
security
Severity:
Important
Release date:
2026-10-09 13:52:31 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.el9.x86_64.rpm
    sha:683c26d46e57b7f7b3a7210709327202e192c71d60365c5fda93ea4e7f82ccc0
  • alt-php55-bcmath-5.5.38-182.el9.x86_64.rpm
    sha:1d5c3b908c35422cebaec56369d2d715fd7fc7e1abd2273671db9ea055ca2cb9
  • alt-php55-cli-5.5.38-182.el9.x86_64.rpm
    sha:6d3ba1de39bc328f227d939c6aaaf16e0e60930cd2a0abbadf4c8280b7559728
  • alt-php55-common-5.5.38-182.el9.x86_64.rpm
    sha:f64e91974c1219f811a40eb8ee2911a112ca0cdffce7303ec1936ae88a543451
  • alt-php55-dba-5.5.38-182.el9.x86_64.rpm
    sha:a540686451e2e29fea4cc148cc3595697e094020ff0aae08f2fd9065ed01f65a
  • alt-php55-dbx-5.5.38-182.el9.x86_64.rpm
    sha:8226205ca7e5a1799e4e825d231cd77833078da687e423ef9191c5650a70bcc6
  • alt-php55-devel-5.5.38-182.el9.x86_64.rpm
    sha:b5b0dadbde0a987949f3856c63fd76c18359cf85cf825360a090b7f78770f1e0
  • alt-php55-enchant-5.5.38-182.el9.x86_64.rpm
    sha:64c919d3dda6cc1ae3f27d7887477b6a53b3495450150f9d91aecbdd95897cc8
  • alt-php55-firebird-5.5.38-182.el9.x86_64.rpm
    sha:9a3fbf3904acc84103200093ba50667b828869e0962633c2d9f2ec33c604c322
  • alt-php55-gd-5.5.38-182.el9.x86_64.rpm
    sha:ced6c9f836d362e84461362b6d8afaad707fbed3977ee5c6b9a4e6fe50a7ddcc
  • alt-php55-imap-5.5.38-182.el9.x86_64.rpm
    sha:a150d7acd0f435a60ca19af2daea61323bd53ea57f9a170f80a8f82314af8a4d
  • alt-php55-intl-5.5.38-182.el9.x86_64.rpm
    sha:28be3382f64a427588afbed12e8e9c0196907bc6c34acf31e476cc4ade302d23
  • alt-php55-ldap-5.5.38-182.el9.x86_64.rpm
    sha:46077ee1783723dc26873dbe508a012a435806e5cd1e7eb97e1ee45bb4c96a1f
  • alt-php55-mbstring-5.5.38-182.el9.x86_64.rpm
    sha:0da4fbd04ee88d6d03c7338a04b1f2f98dbd15f8fc0cc1d5346cd7655f4d919f
  • alt-php55-mcrypt-5.5.38-182.el9.x86_64.rpm
    sha:89f06a71d555dd99ebf81b5b9fdb2800a397ac2a25508aba84f627d05d4384ee
  • alt-php55-mssql-5.5.38-182.el9.x86_64.rpm
    sha:697a153c54b42f36b05fcd649b56e7030adc4a44e02f12c4a4af45c38b3cfb0e
  • alt-php55-mysqlnd-5.5.38-182.el9.x86_64.rpm
    sha:192ea0adc6ac46520b3a54130a709da783651aa4ce5309193c42cc4b7477296d
  • alt-php55-odbc-5.5.38-182.el9.x86_64.rpm
    sha:8758dda21fd11e0b8f068512460f305182533908cef425c955941fab20e299f2
  • alt-php55-opcache-5.5.38-182.el9.x86_64.rpm
    sha:c6bedc7a847bb66fb5bee96323b8828eb84e78e1e69b089709618c7991e968c9
  • alt-php55-pdo-5.5.38-182.el9.x86_64.rpm
    sha:309318c0c9f41bc1f0828cda40ec389d6f4c499132dc4ad789617940cb09f158
  • alt-php55-pgsql-5.5.38-182.el9.x86_64.rpm
    sha:2d4b35981458c59f8c8c9a58ee27e506fa2cc1d25a780c9aff8bdbaaa94d23c4
  • alt-php55-php-fpm-5.5.38-182.el9.x86_64.rpm
    sha:0bcfacfb51b688eefbf061f4408892e3825f45213dca68a1ce84fa1dec867537
  • alt-php55-process-5.5.38-182.el9.x86_64.rpm
    sha:b87aafbc8bbfb95d569ea3bea5474d603a7f2e45eae62e9457817ebb7f977ea5
  • alt-php55-pspell-5.5.38-182.el9.x86_64.rpm
    sha:620e8714985b215506dc92e7b6d9f48a01b6cad703e258e5994aabe9a948847c
  • alt-php55-recode-5.5.38-182.el9.x86_64.rpm
    sha:a5296ef682e24eb019173e693c2dc137984aea905dc8ce5b1e1d5c8a1cb2000a
  • alt-php55-snmp-5.5.38-182.el9.x86_64.rpm
    sha:2f6879bc5050841dfc1768d715fe94a9761094132c6386b9b1be82834bca5184
  • alt-php55-soap-5.5.38-182.el9.x86_64.rpm
    sha:e0db65b9096aae2a7757d554f6e7236891ee2e8067da4a3df2133832c292fa78
  • alt-php55-sybase-5.5.38-182.el9.x86_64.rpm
    sha:80aabeaae5e3a384bae131b67ed5ea9f71239108ba4a5c60c557a0e09e130e5f
  • alt-php55-tidy-5.5.38-182.el9.x86_64.rpm
    sha:425c1eb4f7b9e33ffad0ca7a6c668b444313eb7191a64b4279d595a07094df45
  • alt-php55-xml-5.5.38-182.el9.x86_64.rpm
    sha:c7864deec8e1932ea05430a23e5db7474f8689b80dcaaac586d5db3dad6f8304
  • alt-php55-xmlrpc-5.5.38-182.el9.x86_64.rpm
    sha:9036e68f180ea3a3b869eba91998cbab73007f7ec2591f7551746e0bb69338e8
Notes:
This page is generated automatically and has not been checked for errors. For clarification or corrections please contact the CloudLinux Packaging Team.