Repository navigation
fix(Security): prevent TypeError when CSRF cookie is an array - #10724
Merged
michalsn merged 2 commits intoNov 5, 2026
Merged
Conversation
gr8man
force-pushed
the
fix/csrf-cookie-array-typeerror
branch
from
November 4, 2026 20:03
50248c5 to
6916525
Compare
michalsn
reviewed
Nov 4, 2026
michalsn
left a comment
Member
There was a problem hiding this comment.
Please change "unhandled HTTP 500 error / DoS" to "HTTP 500 response for affected requests" in the PR description. The TypeError reaches the framework's exception handler, which returns a 500. A malformed cookie can repeatedly fail requests that initialize the Security service, but this does not establish an application-wide or server-wide DoS.
Please also add a brief entry under Bugs Fixed in the current changelog.
paulbalandan
approved these changes
Nov 5, 2026
neznaika0
approved these changes
Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes a
TypeErrorinSecurity::__construct()when the CSRF cookie contains array data (e.g.,Cookie: csrf_cookie_name[malicious]=array).IncomingRequest::getCookie()can return an array, which caused a fatalTypeErrorwhen assigned to typed propertyprivate ?string $hashInCookie, resulting in an HTTP 500 response for affected requests. Any non-string cookie value is now safely treated asnull, allowing a clean CSRF hash to be generated.Checklist: