-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Under certain conditions, disabling CSRF for a route doesnt work (Debugging included) #6838
Comments
@kinsi55 Thanks for posting! We'll take a look as soon as possible. In the mean time, there are a few ways you can help speed things along:
Please remember: never post in a public forum if you believe you've found a genuine security vulnerability. Instead, disclose it responsibly. For help with questions about Sails, click here. |
Hey, @kinsi55—any chance you could create a simple repo that reproduces this error? Thanks! |
Nevermind the previous comment, that was related to my PR I mixed it up. I dont have the time to setup a repo for this rn but the way you can repro it is by having a route like this:
Trying to post to |
@kinsi55 |
Hey, @kinsi55! |
Node version: 8
Sails version (sails): 1.2.3
In
sails/lib/hooks/security/csrf/index.js
Line 32 in b3afed7
Due to the
path
being lowercased, if you have a RegEx pattern with uppercased letters, it will then fail to properly match against a given request URL further down and thus always return Forbidden.sails/lib/hooks/security/csrf/index.js
Line 99 in b3afed7
I'm not sure if there would be any regressions from removing the .toLowerCase() but certainly this shouldnt be desired behaviour.
The text was updated successfully, but these errors were encountered: