Under certain conditions, disabling CSRF for a route doesnt work (Debugging included)
See original GitHub issueNode version: 8 Sails version (sails): 1.2.3
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.
I’m not sure if there would be any regressions from removing the .toLowerCase() but certainly this shouldnt be desired behaviour.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Disabling CSRF protections is security-sensitive
A cross-site request forgery (CSRF) attack occurs when a trusted user of a web application can be forced, by an attacker, to perform...
Read more >CSRF Failed: CSRF token missing or incorrect - Stack Overflow
Permanent Solution: If you are using Postman, First, clear the existing cookies by clicking 'X' s. Then add correct cookie. Temporary Solution (for...
Read more >CSRF Protection in Flask - TestDriven.io
This article looks at how to prevent CSRF attacks in Flask. Along the way, we'll look at what CSRF is, an example of...
Read more >CSRF Protection - Jenkins
To disable CSRF protection, set the system property hudson.security.csrf.GlobalCrumbIssuerConfiguration.DISABLE_CSRF_PROTECTION to true on startup. Learn more ...
Read more >Config.php Parameters - ownCloud Documentation
Set this to the empty string if you do not want to copy any skeleton files. A valid path must be given for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@kinsi55 We were able to reproduce this and were able to actually hit the root if we changed the CAPS to lowercased characters. We’re going to further investigate what the deal is with
.toLowerCase()
and any true regressions for working around it to allow CAPS in the RegEx patterns as well.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
/CAPS/foo
will then still require CSRF