[php-src] PR #22356: Guard against short server scramble in sha256_password auth
| From: | iliaal | Date: | Wed, 17 Jun 2026 19:16:14 +0000 |
| Subject: | [php-src] PR #22356: Guard against short server scramble in sha256_password auth | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36487@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22356
Author: iliaal
mysqlnd_sha256_auth_get_auth_data() XORs SCRAMBLE_LENGTH (20) bytes of the server-supplied scramble
into the password without checking the scramble is at least that long, unlike the native and
caching_sha2 plugins which reject a short scramble with CR_MALFORMED_PACKET. A server reporting a
scramble shorter than 20 bytes shrinks the heap buffer the scramble is copied into, so the XOR reads
past it. Add the same length guard the sibling plugins use.