[php-src] PR #22074: ext/session: reject null bytes in session.cookie_path, session.cookie_domain, session.cache_limiter
| From: | jorgsowa | Date: | Sun, 17 May 2026 16:58:49 +0000 |
| Subject: | [php-src] PR #22074: ext/session: reject null bytes in session.cookie_path, session.cookie_domain, session.cache_limiter | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36151@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22074
Author: jorgsowa
Reject null bytes in
session.cookie_path, session.cookie_domain,
session.cache_limiter.
- cookie_path / cookie_domain: When the session cookie was sent,
php_session_send_cookie() built the Set-Cookie header including the raw null byte. The
SAPI layer (sapi_header_op) emitted a generic E_WARNING: Header may not contain NUL
bytes and returned FAILURE, but php_session_send_cookie() did not check that
return value and returned SUCCESS — so the session cookie was silently dropped while
session_start() still returned true.
- cache_limiter: The limiter name is looked up via strcasecmp(lim->name,
ZSTR_VAL(PS(cache_limiter))), which stops at the null byte, so "nocache\0evil"
would silently behave as "nocache". The null byte was effectively ignored but still
accepted without complaint.