[GIT-PULLS] [php-src] PR #23497: [mysqlnd] Fix OK packet message length buffer over-read
[email protected] (iliaal)
| Newsgroups | php.git-pulls |
|---|---|
| Message-ID | <[email protected]> |
Pull Request: https://github.com/php/php-src/pull/23497 Author: iliaal php_mysqlnd_ok_read() reads the length-encoded message length after its last bounds check, so a hostile varint at the end of an OK packet filling the 4096-byte buffer pushes p past header.size and the buffer end, underflows the MIN(net_len, buf_len - (p - begin)) clamp, and mnd_pestrndup() copies attacker-controlled bytes beyond the allocation. Smaller packets left stale command-buffer content in the message. A message length that extends past the payload is now rejected, matching php_mysqlnd_auth_response_read() from GHSA-h35g-vwh6-m678.