Fix for antivirus errors might be impacting security
Categories
(Core :: Security: PSM, defect)
Tracking
()
People
(Reporter: mozsecurity, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0
Steps to reproduce:
Read Thayler's blog about fixing antivirus errors and can't agree that it doesn't compromise security.
As explained in bug 1612994 this can cause auto-import of certificates contained in Windows CA trust store from non-public CAs not needed for fixing antivirus errors and not safe to be trusted.
Actual results:
Private PKI CA certificates not needed for working internet connectivity, maybe not conform to security standards are trusted too and could be potentially abused.
This could be an issue when these i. e. were forgotten WiFi CA certificates from an university and some malware compromised the private keys (without the users having received/read/acted on the abuse report) and uses them for MiTM attacks elsewhere (without the computer running Firefox having malware on it except the left over abused certificate in the Windows trust store).
Expected results:
Wouldn't it be better to define a path (in the file system) where the antivirus vendors have their software to put the CA certificate and having Firefox trying the certificate in this path only than to import all non-OS CA certificates?
Another possibility would be to force the antivirus vendors to use the enterprise JSON policy options for certificate injection (this seems to also work on non-ESR editions if the file isn't removed by Firefox updates).
Another possibility which should work quickly without the AV vendors have to change their programs immediately would be to restrict the automatically imported names to specific well-known names (other purpose CA certificates shouldn't infringe the AV vendors trademarks). From studies you might know whether this might work or not (whether the names are well-known or random).
So Firefox could work for home users with intercepting AV software without the potential for other purpose CA certificates to sacrifice the security.
(another possibility would be a possibility to blacklist private-PKI CA certificates, but there might be no public OCSP and the certificates/private keys might have been encrypted/deleted)
| Reporter | ||
Comment 1•6 years ago
|
||
I have no information that private keys really have been compromised anywhere, I only think that this might be possible given the current malware threat landscape and it would also protect against the abuse of private CA certificates in the Windows CA trust store being there for other purposes (as long as they are not manually imported into Firefox too or being injected there by malware - but that would be definitively nothing which could be technically prevented anymore).
Updated•6 years ago
|
Comment 2•6 years ago
|
||
How is this a different issue from bug 1612994?
| Reporter | ||
Comment 3•6 years ago
|
||
While it is being based on the same configuration option bug 1612994 was more about the inability to have no trust in private PKI certificates being used for wireless connections/VPN (which might be solved by having an option to explicitly distrust them even when they are in the Windows CA store as they are being known by the issuer) and the reasons why this is bad.
This bug is more about this configuration option not meeting the expectations (giving home users with intercepting antivirus software a smooth experience while not putting them at risk) as it unconditionally trusts all certificates in Windows trust store
Windows trust store might contain
a) untrustworthy CA certificates from hardware developers (known private keys)
b) certificates not really intended for being trusted for browsing
c) certificates not conforming to Mozilla Root Trust program, but being trusted by Microsoft
c) even certificates being left over by not completely removed malware (if the malware isn't there anymore and Firefox is being installed afterwards and the malware didn't leave any fake configuration profiles unconditionally trusting the Windows CA store puts users at security risks they would not have if the Windows CA store wasn't trusted).
So automatically putting unconditional trust in something potentially untrustworthy is weakening security if the intend was to trust one specific certificate.
Comment 4•6 years ago
|
||
If any of these potentially compromising certs are in your OS store, then every other browser that uses that store is equally compromised (IE, Edge, Chrome, Opera, Brave, etc). The problem is not us using these certs it is the process that led to the machine configuration being vulnerable.
If the process that led to this configuration was malicious then it could easily have compromised Firefox using the mechanism set up for enterprises and a-v that we used prior to reading the OS store.
| Reporter | ||
Comment 5•6 years ago
|
||
IE and Edge are a bad example as these are OS browsers and as such their web sessions are supposed to be "compromised" by the OS certificates anyway. So the suggestion is to use a third-party browser. Unfortunately you can't use Chromium-based browsers for this purpose as they are using the Windows trust store on Windows systems. As Safari doesn't exist on Windows (anymore?), the probably only useful browser left would be Firefox (Firefox should not be the last browser to consider, but for comparision with the others it has to be the last one).
As Firefox comes with it own certificate trust store (Mozilla Root Trust program) it would make sense to trust its developers to be careful and connections to be secure (privacy claim). Unfortunately Firefox in its default configuration puts trust in potentially insecure certificates. Using these certs leads to Firefox being vulnerable and connections made by Firefox to be vulnerable to MITM attacks by untrustworthy certificates.
Sorry, but in my opinion your arguments are like having an app lacking proper input validation and claiming that it is not the fault of the app, but of the source of malicious input. It is clear that you have to depend on some components of the OS to be not malicious/vulnerable, but I don't think that this has to be true for the OS trust store. One untrustworthy certificate in the OS trust store should not lead to connections in Firefox to be insecure.
As the new mechanism has weaknesses too, why not trying to harden Firefox further?
If the other browser vendors don't care about security it is their problem when users move on to more secure browsers. If you say that it is OK to be as bad as all the others, security oriented users will ask why they should use your browser (I would say: because it currently seems to be the only browser which gives users the OPTION not to trust the OS trust store, but wouldn't it be better if you could say: because it is SECURE BY DESIGN in its default options)?
Comment 6•6 years ago
|
||
Note that since you feel strongly about this but it solves an undeniable issue that many users have, I'm not sure we'll get to a completely satisfactory resolution here. There are prefs like security.certerrors.mitm.auto_enable_enterprise_roots and security.certerrors.mitm.priming.enabled that you can simply disable to turn priming and auto-importing off.
Mike, should we consider exposing those through enterprise policies?
| Reporter | ||
Comment 7•6 years ago
|
||
Don't know how enterprise policies could improve security for home users. It might help admins which want to tell their users how to configure Firefox safely (but probably this would already work with manually deploying prefs). It won't help if users install vanilla Firefox on their (private) computers.
Wouldn't it be better the other way round? Disabling this feature as default and manually enabling it via enterprise policies for those who need it (but I think enterprises could currently solve this with the given enterprise polices to manually include defined certificate files).
The only group left would be home users with intercepting antivirus programs which would have no access/a scaring warning when they want to access internet. But even for those I think it would be better to add trust only to the specific certificate of their antivirus program and not to trust all unknown certificates in the Windows trust store.
Maybe it would be better to show users the MITM certificate and to ask them whether they have installed a new intercepting antivirus program (if the certificate is also found in the Windows trust store) or have Firefox started for the first time and whether they want to import the certificate.
Comment 8•6 years ago
|
||
But even for those I think it would be better to add trust only to the specific certificate of their antivirus program and not to trust all unknown certificates in the Windows trust store.
Yes, we said that this would be better, too, IIRC, but there's more work needed for that (i.e. it's a little cumbersome to verify that that cert actually fixes the connection as opposed to all other certs or a combination of them) and this is a really urgent issue. Dana, I think we briefly talked about this, did we have a follow-up bug for this idea (again, the cost-benefit calculation is a bit unclear, here)?
| Reporter | ||
Comment 9•6 years ago
|
||
I had a mistake in thinking: home users with intercepting antivirus programs might be at risk anyway if the antivirus trusts the certificates in the OS store as Firefox only sees the certificate of the antivirus (or the real if the website is on the exclusion list). For those there is nothing Firefox can do (except preventing malicious certificates to intercept the connection between Firefox and the antivirus program).
For Firefox there should be only one additional CA certificate necessary (the CA certificate of the antivirus).
But users without intercepting antivirus programs shouldn't be put at risk.
Comment 10•6 years ago
•
|
||
We've had no reports of interest in these prefs from enterprises.
Most want to import certs from the OS and use the existing policy to do that.
Comment 11•6 years ago
|
||
Wouldn't it be better the other way round? Disabling this feature as default and manually enabling it via enterprise policies for those who need it (but I think enterprises could currently solve this with the given enterprise polices to manually include defined certificate files).
This fix wasn't for enterprises, it was for end users. Enterprises already know how to solve this problem. This problem exists because antivirus install MITM certs and break end users.
Comment 12•6 years ago
|
||
(In reply to Johann Hofmann [:johannh] from comment #8)
But even for those I think it would be better to add trust only to the specific certificate of their antivirus program and not to trust all unknown certificates in the Windows trust store.
Yes, we said that this would be better, too, IIRC, but there's more work needed for that (i.e. it's a little cumbersome to verify that that cert actually fixes the connection as opposed to all other certs or a combination of them) and this is a really urgent issue. Dana, I think we briefly talked about this, did we have a follow-up bug for this idea (again, the cost-benefit calculation is a bit unclear, here)?
It feels like the "right" thing to do from a security perspective, but I'm not convinced it actually improves security. My reasoning is as follows:
- suppose the OS has trusted 3rd-party roots A and B
- root A is local antivirus MITM
- Firefox detects the MITM and imports A and B
- AV MITM can now intercept all traffic
I think the concern here is that anyone with the private key for B can now also intercept the user's traffic. The proposed solution then is to only import root A. However, since root B is trusted by the system, the AV MITM probably trusts it, so the end effect is the same. If the AV MITM doesn't trust it, then having Firefox import B won't have any security impact unless the user disables the AV MITM. However, at that point, an attacker could use the same root-specific autodetection to convince Firefox to import root B.
In the end, it doesn't improve security and isn't worth the effort.
| Reporter | ||
Comment 13•6 years ago
|
||
(In reply to Mike Kaply [:mkaply] from comment #10)
We've had no reports of interest in these prefs from enterprises.
Most want to import certs from the OS and use the existing policy to do that.
Regarding no interest from enterprises:
There is a policy
"policies": {
"Certificates": {
"Install": ["xxx.crt"]
}
which can install CA certificates from a file (I used it for injecting our own CA certificate (which is trustworthy anyway because it has a DNS name constraint to our domain and you have to trust the domain admin anyway for the servers he is responsible for, but it can not be misused for i.e. banks, shops, ... even if someone would have stolen the key - except if the browser would not honor the DNS name constraint)).
Before this I had to overwrite cert8.db and cert9.db.
In my opinion injecting only trustworthy certificates is the way to go.
| Reporter | ||
Comment 14•6 years ago
|
||
I noticed that my verifications have been tampered with by an (intercepting) antivirus. For testing purposes I had disabled the https interception and had deleted all Mozilla folders in the AppData subdirectories of the user profile.
Unfortunately the antivirus modifies Firefox via a pref file in the Firefox install directory:
pref("security.enterprise_roots.enabled", true, locked);
It seems to recreate this file when Firefox is started (unless Firefox itself would create it).
So in fact I was not testing the MITM behavior of Firefox when accessing a web page having a certificate signed by a CA which is only in the Windows trust store but the above preference.
While one would expect only the antivirus MITM certificate to be additionally trusted (which in fact is useless if it is not intercepting) the configuration trusts all certificates in the Windows trust store and thus allows third-parties having CA certificates injected into the Windows trust store to spy on users.
While it is the antivirus fault to enable this preference even with https interception disabled (I think I will have to complain to the antivirus vendor about this), it shows that one would be safer if only the really needed certificates would be injected as the other CA certificate wouldn't have been trusted then. But I seem to be complaining about the enterprise_roots preference as I obviously didn't test the preferences of the antivirus fix (which isn't used by AV vendors?).
| Reporter | ||
Comment 15•6 years ago
|
||
Update: On the "Fixing Antivirus Errors" blog you can read:
If it fixes the problem, then the “enterprise roots” preference will remain enabled (unless the user manually sets the “security.enterprise_roots.enabled” preference to false). We’ve tested this change to ensure that it doesn’t create new problems. We are also recommending as a best practice that antivirus vendors enable this preference (by modifying prefs.js) instead of adding their root CA to the Firefox root store.
So this is not the fault of the antivirus vendors as they are just following the "official" recommendation.
Since Firefox 65 there is the possibility to import specific certificates only (via GPO and policy JSON): see policy-templates/README.md on github. So the Firefox developers are recommending AV vendors to set the enterprise_roots.enabled setting to trust ANY certificate in the OS store rather than to import the specific certificate which really has to be trusted? Could you please clarify the reasons behind this so that I can understand your decision?
Regarding the antivirus program: The tested one has a setting to import certificates and to change the trust settings (so it should be able to distrust specific certificates when it intercepts the traffic).
Comment 16•6 years ago
|
||
(In reply to Dana Keeler (she/her) (use needinfo) (:keeler for reviews) from comment #12)
(In reply to Johann Hofmann [:johannh] from comment #8)
But even for those I think it would be better to add trust only to the specific certificate of their antivirus program and not to trust all unknown certificates in the Windows trust store.
Yes, we said that this would be better, too, IIRC, but there's more work needed for that (i.e. it's a little cumbersome to verify that that cert actually fixes the connection as opposed to all other certs or a combination of them) and this is a really urgent issue. Dana, I think we briefly talked about this, did we have a follow-up bug for this idea (again, the cost-benefit calculation is a bit unclear, here)?
It feels like the "right" thing to do from a security perspective, but I'm not convinced it actually improves security. My reasoning is as follows:
- suppose the OS has trusted 3rd-party roots A and B
- root A is local antivirus MITM
- Firefox detects the MITM and imports A and B
- AV MITM can now intercept all traffic
I think the concern here is that anyone with the private key for B can now also intercept the user's traffic. The proposed solution then is to only import root A. However, since root B is trusted by the system, the AV MITM probably trusts it, so the end effect is the same. If the AV MITM doesn't trust it, then having Firefox import B won't have any security impact unless the user disables the AV MITM. However, at that point, an attacker could use the same root-specific autodetection to convince Firefox to import root B.
In the end, it doesn't improve security and isn't worth the effort.
I think that's is a great point and considering this, I'm not sure there's anything actionable to this bug. We know we want to have auto-importing and we consider both prompting as well as selectively importing ineffective in actually protecting the user. I think this bug can be closed.
| Reporter | ||
Comment 17•6 years ago
|
||
What is the reason for Firefox to be ever in the need to import root B at all (for proper function) ? If there is a AV MITM, Firefox should see either the AV MITM CA (which the AV should tell Firefox) or a real root CA (which should be in Mozilla Root Trust program).
A MITM AV should be intelligent enough to be able to put its certificate i.e. in a special subfolder of Firefox (which can be only written to with high privileges) or to configure Firefox to add trust to this certificate only.
"However, at that point, an attacker could use the same root-specific autodetection to convince Firefox to import root B."
That is why auto-importing certificates which trust you can't verify isn't a good idea (you don't know whether you are importing the "trusted" certificate of a MITM AV or something completely untrustworthy).
Regarding the trust of the AV: you don't know its configuration, so you can't say that it trusts the certificate - imagine it is configured not to trust this certificate.
Comment 18•6 years ago
|
||
Yes if everyone played along nicely our jobs would be much easier. We hoped that folks would opt-in for a long time, still many users found their Firefox broken in the real world. This project was specifically fixing that.
Comment 19•6 years ago
|
||
(In reply to mozsecurity from comment #17)
That is why auto-importing certificates which trust you can't verify isn't a good idea (you don't know whether you are importing the "trusted" certificate of a MITM AV or something completely untrustworthy).
We only import these certificates if the OS trusts them, which means at some point the user or an administrator trusted them. Scenarios where the user configured their OS to be unsafe and then forgot about it are out of scope for us.
| Reporter | ||
Comment 20•6 years ago
|
||
On the website of a German computer magazine covering security issues you can read about certificates from big hardware vendors like Lenovo, Dell, Sennheiser CVE-2018-17612, ... and that malware likes to use Windows certificate system (i.e. Retefe), where the certificates were not always completely removed by AV products.
Somewhere in one of this articles you could also read that Firefox would be "immune" to the tampering of the Windows trust store as it uses its own certificate store (seems to be a dangerous recommendation nowadays (without an advisory how to prevent Firefox from trusting the untrustworthy)).
Do you want to say you are 100% sure that an administrator or user actively and intentionally trusted those certificates?
Windows also uses Automatic Root Certificates Update (don't know if you use that to determine whether a certificate is a third-party certificate or if you believe those certificates to be third-party too).
| Reporter | ||
Comment 21•6 years ago
|
||
(In reply to Johann Hofmann [:johannh] from comment #18)
Yes if everyone played along nicely our jobs would be much easier. We hoped that folks would opt-in for a long time, still many users found their Firefox broken in the real world. This project was specifically fixing that.
My recommendation was to import the MITM certificate only:
"https://github.com/mozilla/policy-templates/blob/master/README.md
See the certificates --> install section (JSON and GPO)."
Received a reply from an antimalware vendor was:
"We were not aware of this option until now, thank you for reporting it. We will consider it."
So maybe one should not only hope, but have some kind of information exchange with the antimalware industry (I can only tell you what the security team of one antimalware vendor answered and as they claim to have had no information about this option, so the information might have not reached the responsible teams).
Don't know whether this could be through an organization like EICAR (where they agreed on having a common test file) or some independent antivirus testing lab which could have a proper secure integration with the browser as test criteria.
Comment 22•6 years ago
|
||
(In reply to mozsecurity from comment #21)
(In reply to Johann Hofmann [:johannh] from comment #18)
Yes if everyone played along nicely our jobs would be much easier. We hoped that folks would opt-in for a long time, still many users found their Firefox broken in the real world. This project was specifically fixing that.
My recommendation was to import the MITM certificate only:
"https://github.com/mozilla/policy-templates/blob/master/README.md
I think the reasoning for why we don't want to do that is captured in comment 12
After thinking about the points made here, I can understand that modifying this behavior could be something we want to expose to users in a more prominent manner, for example as a checkbox in about:preferences instead of just about:config. This way concerned users could more easily disable the feature, e.g. in case something like the Lenovo thing happens again. I filed bug 1618807 for this.
Description
•