[php-src] PR #22113: ext/session: prevent creation of fixed sid in php_session_rfc1867
| From: | jorgsowa | Date: | Thu, 21 May 2026 21:11:55 +0000 |
| Subject: | [php-src] PR #22113: ext/session: prevent creation of fixed sid in php_session_rfc1867 | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36189@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22113
Author: jorgsowa
The RFC1867 multipart callback captures the session ID from form data to identify which session to
write the upload progress to. When
session.use_only_cookies=1 this capture was not
guarded, allowing the session ID to be accepted from a form field despite the setting's
documented contract of "only accept session ID from cookies."
php_session_rfc1867_early_find_sid() already guards $_GET lookup behind
use_only_cookies, but the form field capture in MULTIPART_EVENT_FORMDATA
had no such guard.
This commit adds the missing check so that when use_only_cookies=1 and no cookie is
present, the form-supplied session ID is ignored and the upload progress is written to a randomly
generated session instead.
I don't know if this is a security fix, so I point to the 8.4 branch.