Skip to content

Commit fe7555a

Browse files
committed
add network.http.referer.XOriginPolicy: 2 in addition to referer spoofing:
Users wanting to disable referer spoofing to workaround listed problems will still be protected against disclosing previously visited pages to target domains when clicking on a link
1 parent b70f602 commit fe7555a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Diff for: README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ HTTP protocol related entries. This affects cookies, the user agent, referer and
233233
* Enable CSP 1.1 script-nonce directive support [ [1](https://bugzilla.mozilla.org/show_bug.cgi?id=855326) ]
234234
* Enable Content Security Policy
235235
* Enable Subresource Integrity [ [1](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) [2](https://wiki.mozilla.org/Security/Subresource_Integrity) ]
236-
* Send a referer header with the target URI as the source [ [1](https://bugzilla.mozilla.org/show_bug.cgi?id=822869) ]
236+
* Send a referer header with the target URI as the source [ [1](https://bugzilla.mozilla.org/show_bug.cgi?id=822869) [2](https://github.com/pyllyukko/user.js/issues/227) ]
237+
* Don't send referer headers when following links across different domains [ [1](https://github.com/pyllyukko/user.js/issues/227) ]
237238
* Accept Only 1st Party Cookies [ [1](http://kb.mozillazine.org/Network.cookie.cookieBehavior#1) ]
238239
* Make sure that third-party cookies (if enabled) never persist beyond the session. [ [1](https://feeding.cloud.geek.nz/posts/tweaking-cookies-for-privacy-in-firefox/) [2](http://kb.mozillazine.org/Network.cookie.thirdparty.sessionOnly) [3](https://developer.mozilla.org/en-US/docs/Cookies_Preferences_in_Mozilla#network.cookie.thirdparty.sessionOnly) ]
239240

@@ -378,6 +379,7 @@ Hardening your often implies a trade-off with ease-of-use and comes with reduced
378379
* Do No Track must be enabled manually
379380
* Spoofing referers breaks functionality on websites relying on authentic referer headers
380381
* Spoofing referers breaks visualisation of 3rd-party sites on the Lightbeam addon
382+
* Spoofing referers disables CSRF protection on some login pages not implementing origin-header/cookie+token based CSRF protection
381383
* Blocking 3rd-party cookies breaks a number of payment gateways
382384
* You can not view or inspect cookies when in private browsing: https://bugzilla.mozilla.org/show_bug.cgi?id=823941
383385
* Installing user.js will **remove your saved passwords** (https://github.com/pyllyukko/user.js/issues/27)

Diff for: user.js

+6
Original file line numberDiff line numberDiff line change
@@ -511,11 +511,17 @@ user_pref("security.sri.enable", true);
511511

512512
// PREF: Send a referer header with the target URI as the source
513513
// https://bugzilla.mozilla.org/show_bug.cgi?id=822869
514+
// https://github.com/pyllyukko/user.js/issues/227
514515
// NOTICE: Spoofing referers breaks functionality on websites relying on authentic referer headers
515516
// NOTICE: Spoofing referers breaks visualisation of 3rd-party sites on the Lightbeam addon
517+
// NOTICE: Spoofing referers disables CSRF protection on some login pages not implementing origin-header/cookie+token based CSRF protection
516518
// TODO: https://github.com/pyllyukko/user.js/issues/94, commented-out XOriginPolicy/XOriginTrimmingPolicy = 2 prefs
517519
user_pref("network.http.referer.spoofSource", true);
518520

521+
// PREF: Don't send referer headers when following links across different domains
522+
// https://github.com/pyllyukko/user.js/issues/227
523+
user_pref("network.http.referer.XOriginPolicy", 2);
524+
519525
// PREF: Accept Only 1st Party Cookies
520526
// http://kb.mozillazine.org/Network.cookie.cookieBehavior#1
521527
// NOTICE: Blocking 3rd-party cookies breaks a number of payment gateways

0 commit comments

Comments
 (0)