-
Notifications
You must be signed in to change notification settings - Fork 232
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
Rewrite Referer preferences/section #227
Comments
I don't think we need any of that. The referer header and how it's currently configured in user.js works perfectly IMO. Doesn't leak any info and doesn't break any sites. I couldn't ask for anything more 😃 Maybe we could remove the commented out |
Pretty open wide choices here, IMHO. Something like
won't maybe break much. |
I have experienced some breakage with |
@nodiscc: Good enough? |
Yes, since But:
So what we'd want instead is
Right? ATM Smart Referer is not e10s-compatible. Finding a way to achieve this with simple Firefox preferences would be great. Or add a note about this problem/known workarounds.
It does, see above |
Spoofing referrers actually disables the CSRF protections that some websites use. It reduces breakage, sure, but it has a security cost. Also discussed on arkenfox/user.js#5 (comment). |
Considering this comment and blog post, would you be ok to
? |
Don't see a reason for that. Proper CSRF protection does not rely (solely) on referer header as it should be implemented with a random token (when used within one site/webapp). Cross-site requests (from one domain to another) can use origin header. If spoofing the referer "breaks" some site's CSRF protection, then it's not implemented properly in the first place, as it shouldn't accept but certain referers. I haven't encountered any anti-CSRF breakage with
Sure.
Don't see a reason for this -> reasoning in my previous comment. |
I understand your point. Relying on referers to prevent CSRF is kinda broken in the first place. Not a big deal, but as I said above I know a few cases where it will break legitimate website functionality (eg. Shaarli relies on referer values to redirect you back where you were before editing a link); would you mind adding
to the referer paragraph in user.js? Then I could start improving the readme generation script proposed in #229 to generate https://github.com/pyllyukko/user.js#known-problems (Use |
Sure, why not. |
I agree with you here. There are however cases where using a token and a cookie isn't possible. Login pages is a common place where referrer checks are done for CSRF purposes (to prevent an attacker from logging you into an account of their choice).
Except that the origin header isn't yet set in Firefox (I'm working on it) so if you want something that works across browsers, you need to use
The problem isn't breakage in this case, it's that the anti-CSRF checks always pass, even in the present of a login CSRF attack. So you're exposing yourself to attacks that would have otherwise been blocked by the referrer check. |
@fmarier @pyllyukko I have added a commit (fe7555a) which is part of PR #239 :
Is this an acceptable compromise? (referers are still spoofed by default. If users want to disable spoofing, there is still a safety net provided by network.http.referer.XOriginPolicy=2. This follows the same reasoning as several other prefs, notably password manager related ones) Edit: arkenfox/user.js#5 (comment) reports that XOriginPolicy > 1 sometimes causes breakage. Should I amend my patch fe7555a, and comment out this pref then? |
That looks good to me. With respect to enabling both, I would point out that if you're restricting referrers to the same site, then there's not much point in spoofing them because the site already gets the real info via their access log. I personally think you may as well leave the same-origin referrers alone to avoid disabling the anti-CSRF code.
The only setting I found that doesn't cause any breakage is the one I added in Firefox 52 ( |
I agree with that and that's why my personal setting is the one you described (don't spoof referers, just don't send them across domains). @pyllyukko expressed referer spoofing would not be disabled in his upstream user.js and that's why I think fe7555a is a reasonable compromise (offer the option to toggle spoofing off while still preventing referer leaks). I still think spoofing should be disabled but that was already debated :/ My end goal is to make our settings easily diffable and well documented so that users can make informed choices on controversial settings like this. Thanks François for your work on Firefox and your help here |
Ok now I understand the point. Thanks for the clarification.
I think we shouldn't enable this. I'm pretty sure it will introduce some problems. |
The referer section is confusing with a commented out item and should probably be clarified/reworded/completed.
We could rewrite it after the referer section on DXR:
The text was updated successfully, but these errors were encountered: