Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make check for RequestVerificationToken case insensitive as per RFC 7230 and RFC 7540. #4959

Conversation

dimarobert
Copy link
Contributor

Fixes #4958

Summary

Properly check for RequestVerificationToken and __RequestVerificationToken in ValidateAntiForgeryTokenAttribute.
The AllKeys property is a plain string[] and Contains is the System.Linq.Enumerable.Contains() which by default does a case-sensitive check.

…230 and RFC 7540.

The AllKeys property is a plain string[] and Contains is the System.Linq.Enumerable.Contains<T>() which by default does a case-sensitive check.
Copy link
Contributor

@bdukes bdukes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Copy link
Contributor

@mitchelsellers mitchelsellers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, and MIGHT be a root cause for some persistent request verification errors that have been reported over the eyears.

@mitchelsellers mitchelsellers merged commit dbdd122 into dnnsoftware:develop Dec 10, 2021
@valadas valadas modified the milestones: 9.10.3, 9.11.0 Sep 28, 2022
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.

MVC ValidateAntiForgeryTokenAttribute does case sensitive checks.
4 participants