[php-src] PR #22923: ext/session: report a rejected session cookie header
| From: | iliaal | Date: | Wed, 29 Jul 2026 18:01:06 +0000 |
| Subject: | [php-src] PR #22923: ext/session: report a rejected session cookie header | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-37339@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22923
Author: iliaal
php_session_send_cookie() dropped the result of sapi_add_header_ex() and
always returned SUCCESS. When the SAPI refuses a Set-Cookie header containing CR or LF, the warning
it emits can reach a userland error handler, and if that handler calls
session_destroy() then php_session_reset_id() carries on and appends the
released PS(id).
Reproducer is a set_error_handler() that destroys the session,
session_set_cookie_params(['path' => "/\r\nX: y"]), then
session_start(): SIGSEGV on 8.4, 8.5 and master, under both CLI and CGI.
php_session_reset_id() has handled a FAILURE from the cookie call since 8.4; it just never saw one.