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
firefox, nss: enable SSLKEYLOGFILE option #48204
Conversation
See https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format: > Note: starting with NSS 3.24 (used by Firefox 48 and 49 only), the > SSLKEYLOGFILE approach is disabled by default for optimized builds > using the Makefile (those using gyp via build.sh are not affected). > Distributors can re-enable it at compile time though (using the > NSS_ALLOW_SSLKEYLOGFILE=1 make variable) which is done for the > official Firefox binaries. (See bug 1188657.) Notably, Debian does not > have this option enabled, see Debian bug 842292. This patch fixes that, and allows other programs to also use this options as they desire, with the `allowSSLKeylogFile` on the nss package. (NOTE: this option is NOT enabled by default on Firefox, the user specifically has to set the SSLKEYLOGFILE environment variable!)
Success on x86_64-linux (full log) Attempted: nss Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: nss Partial log (click to expand)
|
What's the benefit of this? Sounds like enabling a potential security risk to me. |
@xeji @fpletz It would allow for users to capture their own SSL/TLS encrypted traffic with tools like Wireshark. I personally wanted to check how a website was getting its updates, so I opened up Firefox's element inspector (tab Network). The updates weren't showing up in there, so I was looking for a way to allow Wireshark traffic capture through SSL. Most of the suggestions were "Oh, just set this env variable, and you'll be able to decrypt the traffic". I tried this, and it didn't work. It wasn't immediately clear why, until I stumbled upon the link mentioned in the PR. I assumed that what was the case for Debian would also be the case for NixOS. On the security risk side: there is a potential attack, but to exploit it, an attacker has to be able to:
It's possible, but if those conditions are met, you are already screwed I'd say. Furthermore, the official Firefox binaries also include this option. If this is still not wanted, I also see another course of action: give a warning when starting Firefox with the SSLKEYLOGFILE variable set, and have another Firefox package ( P.S. Good question though, glad it is asked rather than blindly merged. |
Thanks for explaining. I don't think we should enable this feature by default. It does increase the attack surface. I agree it's not a straightforward attack, but this might for instance be used by an attacker who has short-term access to your computer to intercept traffic later... For debugging TLS connections there are better options like installing a man-in-the middle proxy (like
Not necessarily. Each distro makes their own tradeoffs. Arch, for instance, does not enable this. That said, I'm fine with adding the option but not with enabling it for firefox by default. A user who really wants it should then override firefox locally.
Definitely not. Since there are good alternatives for debugging, this feature isn't important enough to duplicate firefox. |
I'm really not a fan of having users override Firefox locally, since it takes forever to build. |
I understand. But we also struggle with firefox build timeouts on Hydra, so adding another firefox build doesn't sound great either. |
not rebuilding firefox
Can't you just put it into `LD_LIBRARY_PATH` or something?
Btw, MITMproxy works for all SSL things, not just for NSS.
|
@xeji I don't think having this environment variable is more dangerous then allowing LD_PRELOAD or some environment variable that alters the ca bundle where an attacker can do the same shenanigans. |
@Mic92 I agree, but the fact that other attacks are possible shouldn't stop us from minimizing the attack surface. This basically adds an easily accessible backdoor to NSS, which I don't think is a necessary feature since there are good alternatives for debugging TLS connections. |
So the alternative to this pull request would be documentation how nss can be overriden in combination with LD_LIBRARY_PATH to inject it into firefox. |
Any updates on this pull request, please? |
Thank you for your contributions.
|
Motivation for this change
See https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format:
This patch fixes that, and allows other programs to also use this
options as they desire, with the
allowSSLKeylogFile
on the nsspackage.
(NOTE: this option is NOT enabled by default on Firefox, the user
specifically has to set the SSLKEYLOGFILE environment variable!)
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)