Skip to content

Closed - #157

Closed
Hackwar wants to merge 1 commit into
joomla-framework:4.x-devfrom
Hackwar:4.x-checktoken-validate-header
Closed

Closed#157
Hackwar wants to merge 1 commit into
joomla-framework:4.x-devfrom
Hackwar:4.x-checktoken-validate-header

Conversation

@Hackwar

@Hackwar Hackwar commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

No description provided.

checkToken() only tested whether the X-CSRF-Token header was present; its
value was never compared with the session token, because hasToken() was
always called with the session token itself. Any request carrying the header
with an arbitrary value passed the check.

The header value is now compared with hash_equals(), and a mismatch is
reported to the session so that it expires. The request method is limited
to "post" and "get", other names raised an obscure Input exception or read
unrelated input sources. The tests use a real session instead of mocks that
encoded the bug.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Hackwar Hackwar closed this Nov 13, 2026
@Hackwar Hackwar changed the title [4.x] Compare the X-CSRF-Token header with the session token in checkToken() Closed Nov 13, 2026
@Hackwar
Hackwar deleted the 4.x-checktoken-validate-header branch November 13, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant