Skip to content

AI spam#927

Closed
aizu-m wants to merge 1 commit into
pallets-eco:mainfrom
aizu-m:csrf-constant-time
Closed

AI spam#927
aizu-m wants to merge 1 commit into
pallets-eco:mainfrom
aizu-m:csrf-constant-time

Conversation

@aizu-m

@aizu-m aizu-m commented Jun 2, 2026

Copy link
Copy Markdown

Both CSRF validators compare a secret token against attacker-supplied form data with !=, which short-circuits and leaks a byte-by-byte timing oracle on the expected token; switch SessionCSRF and the base CSRF to hmac.compare_digest (and stop treating a None/None pair as a match).

@ThiefMaster

Copy link
Copy Markdown

This is not a problem for CSRF tokens at all. You can't find out the CSRF token for another user's session that way, so all you could do is trying it for your own session - but that's pointless, because you already have access to it.

@davidism davidism closed this Jun 2, 2026
@davidism davidism changed the title use constant-time comparison for CSRF tokens AI spam Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants