Skip to content

ext/session: prevent creation of fixed sid in php_session_rfc1867#22113

Open
jorgsowa wants to merge 1 commit into
php:PHP-8.4from
jorgsowa:fix/session-upload-progress-use-only-cookies
Open

ext/session: prevent creation of fixed sid in php_session_rfc1867#22113
jorgsowa wants to merge 1 commit into
php:PHP-8.4from
jorgsowa:fix/session-upload-progress-use-only-cookies

Conversation

@jorgsowa
Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant