-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[RFC][Security] Built-in CSRF protection for firewalls #34004
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
Comments
This is a different problem, which could be solved using something like sub filter in NGiNX (by replacing the prod domain with the dev domain on all html output) and Apache probably has something similar. You could even do it with
Those are user provided values, which are easy to temper with. Once a bad actor finds that some domain is exempt from CSRF your door is wide open. Lastly, CSRF is dead 😉 |
My 2cts: we deprecate security-csrf in 5.1, that will give 5 more years for samesite to propagate. |
What might also help is a browser plugin that makes it clear which environment you're in. I have written one for Chrome and configured such that when I am on a production site it shows a big red div with https://chrome.google.com/webstore/detail/requestinfo-display/acjdjhebifgcpdfefkijjeejjckfahoi (the div in the screenshot is gray, but you can override all css properties on a per-configuration basis) |
Hacking Referer indeed requires a tempered browser. But modern browsers allow to restrict the info submitting in the Referer header, including disabling it entirely. So a CSRF solution built on the Referer header could actually be excluding users enabling such privacy feature in their browser. Deprecating cookie-based a bad idea IMO. |
This is an alternative proposal for #13464 and #33171, based on #33171 (comment) and #33171 (comment)
Long story short:
I think it could deprecate the form integration, and probably the entire storage/token concept currently provided by
Security/Csrf
.The new CSRF protection would be based on the
Origin/Referer
header.Imagine restoring a prod DB in your local dev application, which contains links to the prod environment (or e.g. hardcoded URLs in code), based on user navigation you can go from dev to prod without really noticing. Mostly im logged in on both environments and both applications look exactly the same. In this case, we've successfully CSRF attacked ourselfves using GET requests 😓
A global firewall protection would solve it out-of-the-box.
Thoughts?
The text was updated successfully, but these errors were encountered: