[CLSA-2026:1791541582] alt-php53: Fix of CVE-2025-1218
Type:
security
Severity:
Important
Release date:
2026-10-09 10:26:33 UTC
Description:
- CVE-2025-1218: out-of-bounds reads in the mysqlnd wire-protocol parser. A malicious or compromised MySQL server could send a truncated packet and make the client read past the end of the packet buffer. Re-implementation, against the PHP 5.3 mysqlnd sources, of upstream 114dbb74368e6a6cd6e48ddb4a76dbe8728b84e2 (GHSA-r6x9-5r99-36j7, php-8.2.34 / php-8.3.34); the upstream diff does not apply to 5.3 in any form, so every bound was re-derived from 5.3's own bookkeeping. BAIL_IF_NO_MORE_DATA, which only noticed an over-read after it had happened, is replaced by BAIL_PREMATURE_END / BAIL_IF_NOT_ENOUGH_DATA_EX, and php_mysqlnd_net_field_length()/_ll() are given the bytes still left in the packet so a length encoding can no longer be read out of bounds. Memory-safety fixes cover the greeting (its server version string ran estrdup() off a 2048-byte stack buffer with no terminator guarantee on this branch - strictly worse here than on any later branch - plus the 31-byte fixed block and the split scramble), the OK and result-set header packets, the EOF packet, the in-row EOF marker, the result-set field metadata lengths (which leaked heap bytes into user-visible column metadata), the text-protocol row field lengths and ps_fetch_time/date/datetime. The two new checks in prepare_read are HARDENING ONLY and provably cannot fire; the mysqlnd_ps.c change is a memory leak fix on the newly reachable prepare-EOF failure path, not an over-read. The auth-response, SHA256-public-key and caching-sha2 packet readers, the change-user auth-switch branch and the pluggable-auth parts of the greeting do not exist at 5.3, so those parts of the upstream fix have no target here. The 38 upstream .phpt tests are not carried - the fake_server.inc they drive needs PHP 8.0 syntax - so the C fix ships without tests - 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.3.29-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-php53-5.3.29-219.el6.x86_64.rpm
    sha:a840f2f41453f0363bd1e014d7960c225aa336b6b91a9917b683503c27b2b1c0
  • alt-php53-bcmath-5.3.29-219.el6.x86_64.rpm
    sha:90ead3e44fba5aa702b9db41c50b0643fa23170b5fa657b513d06dc684719f5e
  • alt-php53-cli-5.3.29-219.el6.x86_64.rpm
    sha:7e24dac34bca1c820f681bf5d6f651b2a016ea4b16f734b98b2c8d1ac40887c5
  • alt-php53-common-5.3.29-219.el6.x86_64.rpm
    sha:7706ca602303ddb01e3e883e281b6769d2ba03e24058e746260c83e4698e7348
  • alt-php53-dba-5.3.29-219.el6.x86_64.rpm
    sha:780a4a5c1f3b33ee93131e7ed8f7abe96d6af111bc40064143c0b67e21710424
  • alt-php53-dbx-5.3.29-219.el6.x86_64.rpm
    sha:69c847fb4f80820f4aefdeaff3f71d47749e2c35c735fd2c5a85faf613c66a4d
  • alt-php53-devel-5.3.29-219.el6.x86_64.rpm
    sha:c66960960de205d339d9e21bb67bb6807643b40cb4fcdca90cc6bc16b1478257
  • alt-php53-enchant-5.3.29-219.el6.x86_64.rpm
    sha:640a43e6cda0ffdc145cfffa72b7713ed2515bc826ac14ebc66de089b0b15656
  • alt-php53-firebird-5.3.29-219.el6.x86_64.rpm
    sha:1e72390ff1df1d85258f2a001faa2a6610db4a5c822b312d264254a4fa44f37f
  • alt-php53-gd-5.3.29-219.el6.x86_64.rpm
    sha:c7c4d9155450517a8b0de972106db7fed92f241320549d6d052506951bc43550
  • alt-php53-imap-5.3.29-219.el6.x86_64.rpm
    sha:a129c0481cb2f376c95e2c1caf17226740a3efbfb52aa3303da92f910dfb8632
  • alt-php53-intl-5.3.29-219.el6.x86_64.rpm
    sha:b01dadf3de97e04f766eb3f201b93ac4ba61f032d2785fc00ba39b482f72cefb
  • alt-php53-ldap-5.3.29-219.el6.x86_64.rpm
    sha:2ca83c21a30ff7390e784d2765dd4cf2ed091e475f0c7dbe8dd6afe7d6aaaa06
  • alt-php53-mbstring-5.3.29-219.el6.x86_64.rpm
    sha:0425b61646709e843db25fc96c315f3095e8e17945fd563c280f0ac2f19f448c
  • alt-php53-mcrypt-5.3.29-219.el6.x86_64.rpm
    sha:7a3e2ea6f97e6ff81ed16e2f8c5be89df6c14fec04cca71d365cf33bc1a6ceea
  • alt-php53-mssql-5.3.29-219.el6.x86_64.rpm
    sha:1e2cf08c6a06a86d7ced866c61e00865d87a1d60c332ec6cd69168b31db2a153
  • alt-php53-mysqlnd-5.3.29-219.el6.x86_64.rpm
    sha:81da37653ffa8d8916572259bb0b847a2d448440b2788a1dd4e1aff9bb2b1696
  • alt-php53-odbc-5.3.29-219.el6.x86_64.rpm
    sha:9e6d9a4217e6c408b876b1ad349d02c8b4a589bb2aa92ee584a1cd3160286ee4
  • alt-php53-pdo-5.3.29-219.el6.x86_64.rpm
    sha:13c189b6d6b3759eba1a5a0d0f29d6886f38f1ab92c8d03ae15e988016f7ecf6
  • alt-php53-pgsql-5.3.29-219.el6.x86_64.rpm
    sha:a657fa1540e5d9ce027a49417580b46684a1535c62ceb5296189e63f7d0c9d00
  • alt-php53-php-fpm-5.3.29-219.el6.x86_64.rpm
    sha:087e5290c1423071ce548c165f9a325dd8481e234033f489d84777c6bc93837d
  • alt-php53-process-5.3.29-219.el6.x86_64.rpm
    sha:6c603717dc5b3d8bfa905f8d505f9e9c733a675dd3c2ee94035e4609eb98966a
  • alt-php53-pspell-5.3.29-219.el6.x86_64.rpm
    sha:9b343524fc35dda4c3696dfa3426377dcfcbe0a2d5c3b396ed2e099cad303c13
  • alt-php53-recode-5.3.29-219.el6.x86_64.rpm
    sha:61c38b2e807517decc2eae15421c5bb8f9673b0fdae3a1cb67ea53ed4ad12631
  • alt-php53-snmp-5.3.29-219.el6.x86_64.rpm
    sha:8338d5fde5e1939aee6d387f1662caeb2faa15221b02dc5fe6a2ac38c28fc4d1
  • alt-php53-soap-5.3.29-219.el6.x86_64.rpm
    sha:4d92ad7baa82f09c25713522a46c242b50f1c70a4f7238a69e3c126f76e1cf04
  • alt-php53-sqlite-5.3.29-219.el6.x86_64.rpm
    sha:e268eebaf2e9f265324b272ef9ce9eba8ed37c275083e4fccdd46cf472ee9f0d
  • alt-php53-sybase-5.3.29-219.el6.x86_64.rpm
    sha:2b1b9644d07749b4470da2020ccb2cf29228b5aad322b7808707770c756e7c61
  • alt-php53-tidy-5.3.29-219.el6.x86_64.rpm
    sha:0b4c2a67a1cdd5a45e7b7ceced035f315fe39b2d440230fb898c3f3e3cb6573c
  • alt-php53-xml-5.3.29-219.el6.x86_64.rpm
    sha:11504547c72e68ed3c18ce8802a05310e488807c13b3f41daf90f03441bb9f60
  • alt-php53-xmlrpc-5.3.29-219.el6.x86_64.rpm
    sha:ababce619eb64287e180000ff9a629cc7de728168a2700d97b5b603a76240958
Notes:
This page is generated automatically and has not been checked for errors. For clarification or corrections please contact the CloudLinux Packaging Team.