Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Configuring Firefox for security and privacy (as of Oct. 2017)

Configuring/Hardening Firefox for Security and Privacy

Source for some of these

  1. about:config
  • dom.event.clipboardevents.enabled => false
  • clipboard.plainTextOnly => true
  • referer spoofSource => true
  • media.peerconnection
    • enabled => false
    • identity => false
    • video => false
    • use document iceservers => false
  • eme (DRM)
    • disable media.eme, browser.eme
    • disable chromium-api
  • media.navigator.enabled => false (RTC)
  • screensharing
    • allowed domains => ""
    • enabled => false
  • camera.control.face detection.enabled => false
  • dom.event.contextmenu.enabled => false
  • dom.disable_window features
    • all true (disable them)
  • dom.gamepad.enabled => false
  • dom.battery.enabled => false
  • dom.enable user timing => false
  • dom.enable resource timing => false
  • disable dom.vr, dom.vibrator
  • beacon.enabled => false (notifies a website when you navigate away)
  • disable newtabpage (*)
  • reader
    • parse on load => false
  • send pings require same host => true
  • browser.urlbar.trimURLs => false
  • ssl/tls
    • tls.version.min => 2
    • disable all sha1 (search for "sha")
    • disable false start
    • disable all rc4, md5 (if any)
    • sha1 enforcement to 1 (Mozilla)
    • treat unsafe negotiation as broken
    • require safe negotiation
    • security.cert pinning.enforcement level => 2
  • geo
  • => ""
  • javascript.options.strict => true
  • slowStartup (*)
    • maxSamples => 0
    • notificationDisabled => true
  • network.allow experiments => false
  • extensions.pocket
    • enabled => false
    • api, site => ""
  1. Addons
  • uBlock Origin
  • HTTPS Everywhere
  • Privacy Badger
  1. Settings
  • open with blank page
  • DuckDuckGo search
  • Always Ask to open media

Note that settings denoted * are my preference and don't necessarily relate to security or privacy.


This comment has been minimized.

Copy link

Exagone313 commented Oct 30, 2017

You could also add the add-ons: uMatrix (can replace Privacy Badger, for advanced users and much more effective), Multi-Account Containers (to separate website connections), Cookie AutoDelete (it supports rules according to containers). I use also NoScript (without JavaScript blocking) to disable WebGL, and for its protection features: against XSS and ClearClick, but it's a bit buggy in 56 and not yet available fully as web extension. If you use Google you have Google search link fix but it's minor. Also Canvas Defender but it prevents some websites to load (like GMail) and will be partially obsolete in 58+.

If you use uMatrix, you can start with such rules:

https-strict: * true
matrix-off: about-scheme true
matrix-off: behind-the-scene true
matrix-off: chrome-extension-scheme true
matrix-off: chrome-scheme true
matrix-off: opera-scheme true
* * * block
* 1st-party cookie allow
* 1st-party css allow
* 1st-party image allow

(You can remove the cookie line if you don't use Cookie AutoDelete.)

For the settings I have this in /usr/lib/firefox/browser/defaults/preferences/vendor.js (mostly coming from IceCat):

pref("browser.EULA.override", true);
pref("app.update.url", "");
pref("browser.safebrowsing.enabled", false);
pref("browser.safebrowsing.malware.enabled", false);
pref("browser.safebrowsing.phishing.enabled", false);
pref("social.enabled", false);
pref("social.remote-install.enabled", false);
pref("datareporting.healthreport.uploadEnabled", false);
pref("datareporting.healthreport.about.reportUrl", "");
pref("datareporting.healthreport.documentServerURI", "");
pref("healthreport.uploadEnabled", false);
pref("social.toast-notifications.enabled", false);
pref("datareporting.policy.dataSubmissionEnabled", false);
pref("datareporting.healthreport.service.enabled", false);
pref("browser.slowStartup.notificationDisabled", true);
pref("network.prefetch-next", false);
pref("network.dns.disablePrefetch", true);
pref("toolkit.telemetry.enabled", false);
pref("toolkit.telemetry.unified", false);
pref("plugins.enumerable_names", "");
pref("plugin.state.flash", 0);
pref("", false);
pref("dom.battery.enabled", false);
pref("device.sensors.enabled", false);
pref("camera.control.face_detection.enabled", false);
pref("camera.control.autofocus_moving_callback.enabled", false);
pref("network.http.speculative-parallel-limit", 0);
pref("app.update.enabled", false);
pref("", false);
pref("media.eme.enabled", false);
pref("media.eme.apiVisible", false);
pref("media.peerconnection.enabled", false);
pref("", true);
pref("", "");
pref("", "");
pref("handlerService.schemes.mailto.1.uriTemplate", "");
pref("gecko.handlerService.schemes.mailto.0.uriTemplate", "");
pref("browser.contentHandlers.types.0.title", "");
pref("browser.contentHandlers.types.0.uri", "");
pref("browser.contentHandlers.types.1.title", "");
pref("browser.contentHandlers.types.1.uri", "");
pref("", "");
pref("gecko.handlerService.schemes.webcal.0.uriTemplate", "");
pref("", "");
pref("gecko.handlerService.schemes.irc.0.uriTemplate", "");
pref("font.default.x-western", "sans-serif");
pref("extensions.webservice.discoverURL", "");
pref("", "");
pref("pfs.datasource.url", "");
pref("pfs.filehint.url", "");
pref("geo.enabled", false);
pref("geo.wifi.uri", "");
pref("media.gmp-manager.url", "");
pref("media.gmp-manager.url.override", "data:text/plain,");
pref("media.gmp-provider.enabled", false);
pref("media.gmp-gmpopenh264.enabled", false);
pref("media.gmp-eme-adobe.enabled", false);
pref("browser.selfsupport.url", "");
pref("browser.apps.URL", "");
pref("", "");
pref("", "");
pref("browser.newtabpage.introShown", true);
pref("browser.aboutHomeSnippets.updateUrl", "data:text/html");
pref("browser.casting.enabled", false);
pref("social.directories", "");
pref("browser.pocket.enabled", false);
pref("extensions.pocket.enabled", false);
pref("network.IDN_show_punycode", true);

And if you want to build Firefox, you can add this to your .mozconfig (not sure if all exports do something, it's copied from multiple places like IceCat):

ac_add_options --disable-eme

export MOZ_PAY=0
export MOZ_DEVICES=0

This comment has been minimized.

Copy link

taoeffect commented Oct 31, 2017

network.IDN_show_punycode => true is an important one to protect from fishing.


This comment has been minimized.

Copy link

myfreeweb commented Nov 1, 2017

@taoeffect not that important, all modern browsers automatically show punycode when they detect mixed alphabets


This comment has been minimized.

Copy link

Thorin-Oakenpants commented Nov 24, 2017

FYI: Your source listed above ( ) is an very old early copy of this original source ( ) which was updated numerous times (we got up to version 11, looks like the one linked is version 1 or something) before moving to github right here -> I only bring this up because the linked source contains deprecated prefs and some factual errors etc - like I said, it got reworked and tweaked lots (about 7 times in the first week as ghacks readers contributed and collectively fixed things)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.