You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Test CA repository does not reflect Firefox state #6569
PR #6102 gives an example of a host which whose SSL configuration will cause breakage in Firefox (due to an invalid chain) but which passes the fetch test.
When you visited a site with the same cert chain before, the browser caches the chain and doesn't show any errors.
As far as I know we integrated some cert chains in our test infrastructure that tests don't fail. We may reconsider this.
They are located in "test/rules/platform_certs/", but they might only be used on rules with platform CAcert or incomplete (do we have a platform for that?) specified.
@J0WI: The ones in test/rules/platform_certs/default are exactly the ones that fetch-test.sh and friends use, so those are the ones that would appear to be out of sync.
My rule of thumb has been that a rewrite works if the https and http version of a page do the same thing: return the same content, have the same 4xx error, whatever. If a site is misconfigured to not correctly fetch an intermediate certificate, the two versions don't do the same thing and the rule is bad. So by this rule of thumb, I don't think we should include prefetched intermediate certificates in our tests.
How do we add new roots when they are added to Mozilla's root program? (we don't, or do it ad-hoc)
How do we add new intermediates?
We include intermediates because some sites fail to include those intermediates, which will break curl, but not necessarily Firefox (since Firefox has different certificate caching logic). I'm not sure how @hiviah generated the original set, but for similar work in the SSL Observatory we've, in the past, generated the transitive closure of all intermediates from trusted roots. To keep the list up-to-date, I've occasionally used the ad-hoc script in test/rules/platform_certs/get-issuer.sh.
Perhaps a better long-term solution would be to use the public CT logs. Not guaranteed to be comprehensive, but given that Google pushes certs from their crawls into those logs, most likely all the intermediates we care about would show up there.
We include intermediates because some sites fail to include those intermediates, which will break curl, but not necessarily Firefox (since Firefox has different certificate caching logic). I'm not sure how @hiviah generated the original set, but for similar work in the SSL Observatory we've, in the past, generated the transitive closure of all intermediates from trusted roots. To keep the list up-to-date, I've occasionally used the ad-hoc script in test/rules/platform_certs/get-issuer.sh.
I'm actually a bit surprised by this part, as I've typically been able to use curl to catch faulty Firefox behavior. Do we have an example of a host which will break curl but not Firefox?
I don't have one off-hand, but the case where it happens is when the site doesn't provide an intermediate and the Firefox user has previously visited another site that did provide the same intermediate, so the intermediate is cached by Firefox.
You could make an argument against including such sites, because they will break when visited in a completely fresh FF profile, but so far we have included them.
Ah, right, then we're on the same note. But actually, I've avoided including such rulesets exactly because they potentially cause issues; in fact #3107 was more or less motivated by this very phenomenon.
I'd also air on the side of not including hosts which do not provide their intermediates, since this would cause us to force users with a fresh FF profile on to a site they can't access. If these sites are submitted in a PR and we spot this, it may also be worth it to try to reach out to the site maintainers to notify them of the problem.
I generated the original certificate sets from Firefox exported roots and generating transitive closure - with this script.
The intermediates were taken from my own observatories (Perspectives notary fork storing complete chains - notary1.qabs.cz/notary2.qabs.cz, CA certs have separate table which makes export easy)
Using CT would certainly work as well, but you'd have to sieve the certs for intermediate certs.
Also worth noting: Often Chrome will successfully load such misconfigured sites due to something called "AIA chasing:" i.e., the leaf certificate includes metadata telling you where to fetch its parent. Firefox doesn't implement AIA chasing. So that brings additional pressure to include such sites. All that said, I agree that it makes sense to leave them out in general.
I think we should not check with intermediates, except with a platform specified (#6697 (comment)). This would also allow us to not default_off all the affected rules.
Is there an example of a ruleset which failed tests due to its CA not yet being in our store of certs, but may pass with the newest Firefox store of CAs?
Is there an example of a ruleset which failed tests due to its CA not yet being in our store of certs, but may pass with the newest Firefox store of CAs?
Hard to say for sure, but I do not recall ever seeing such an example.
Activity
J0WI commentedon Aug 23, 2016
When you visited a site with the same cert chain before, the browser caches the chain and doesn't show any errors.
As far as I know we integrated some cert chains in our test infrastructure that tests don't fail. We may reconsider this.
J0WI commentedon Aug 23, 2016
They are located in "test/rules/platform_certs/", but they might only be used on rules with platform CAcert or incomplete (do we have a platform for that?) specified.
jeremyn commentedon Aug 23, 2016
This is a useful link for anyone trying to understand this problem: https://wiki.mozilla.org/CA:FAQ .
fuglede commentedon Aug 23, 2016
@J0WI: The ones in
test/rules/platform_certs/defaultare exactly the ones thatfetch-test.shand friends use, so those are the ones that would appear to be out of sync.jeremyn commentedon Aug 23, 2016
Considering @J0WI 's "We may reconsider this.":
My rule of thumb has been that a rewrite works if the https and http version of a page do the same thing: return the same content, have the same 4xx error, whatever. If a site is misconfigured to not correctly fetch an intermediate certificate, the two versions don't do the same thing and the rule is bad. So by this rule of thumb, I don't think we should include prefetched intermediate certificates in our tests.
Hainish commentedon Aug 23, 2016
Looking into this now
Hainish commentedon Sep 1, 2016
I wonder how this list of intermediates was generated in the first place.
The Mozilla CA Certificate Store lists this source file with all of the included root certificates. We could possibly parse this file and generate a new
test/rules/platform_certs/defaultsthat is more current.@jsha, do you know how this was generated in the first place?
fuglede commentedon Sep 1, 2016
Pinging @hiviah as he added them in the first place. Having an automated fetch-and-parser sounds like it would be great.
jsha commentedon Sep 6, 2016
There are two questions:
We include intermediates because some sites fail to include those intermediates, which will break curl, but not necessarily Firefox (since Firefox has different certificate caching logic). I'm not sure how @hiviah generated the original set, but for similar work in the SSL Observatory we've, in the past, generated the transitive closure of all intermediates from trusted roots. To keep the list up-to-date, I've occasionally used the ad-hoc script in test/rules/platform_certs/get-issuer.sh.
Perhaps a better long-term solution would be to use the public CT logs. Not guaranteed to be comprehensive, but given that Google pushes certs from their crawls into those logs, most likely all the intermediates we care about would show up there.
fuglede commentedon Sep 6, 2016
I'm actually a bit surprised by this part, as I've typically been able to use curl to catch faulty Firefox behavior. Do we have an example of a host which will break curl but not Firefox?
jsha commentedon Sep 6, 2016
I don't have one off-hand, but the case where it happens is when the site doesn't provide an intermediate and the Firefox user has previously visited another site that did provide the same intermediate, so the intermediate is cached by Firefox.
You could make an argument against including such sites, because they will break when visited in a completely fresh FF profile, but so far we have included them.
fuglede commentedon Sep 6, 2016
Ah, right, then we're on the same note. But actually, I've avoided including such rulesets exactly because they potentially cause issues; in fact #3107 was more or less motivated by this very phenomenon.
Hainish commentedon Sep 6, 2016
I'd also air on the side of not including hosts which do not provide their intermediates, since this would cause us to force users with a fresh FF profile on to a site they can't access. If these sites are submitted in a PR and we spot this, it may also be worth it to try to reach out to the site maintainers to notify them of the problem.
hiviah commentedon Sep 6, 2016
I generated the original certificate sets from Firefox exported roots and generating transitive closure - with this script.
The intermediates were taken from my own observatories (Perspectives notary fork storing complete chains - notary1.qabs.cz/notary2.qabs.cz, CA certs have separate table which makes export easy)
Using CT would certainly work as well, but you'd have to sieve the certs for intermediate certs.
jsha commentedon Sep 6, 2016
Also worth noting: Often Chrome will successfully load such misconfigured sites due to something called "AIA chasing:" i.e., the leaf certificate includes metadata telling you where to fetch its parent. Firefox doesn't implement AIA chasing. So that brings additional pressure to include such sites. All that said, I agree that it makes sense to leave them out in general.
J0WI commentedon Sep 6, 2016
I think we should not check with intermediates, except with a platform specified (#6697 (comment)). This would also allow us to not
default_offall the affected rules.To catch all the intermediates you may have a look at https://crt.sh/mozilla-disclosures
Update certificates to match latest Firefox (fixes EFForg#6569)
Hainish commentedon Sep 7, 2016
PR #6790 updates the certificate store to reflect the latest Firefox export of roots, as of 48.0.2, and removes all intermediates.
This is still a work in progress, which requires more testing.
Testing with #6789, a PR which passes the fetch test currently on travis, I see a number of new failures:
And indeed, these domains do give a certificate error when accessed from a fresh profile on Firefox.
Hainish commentedon Sep 7, 2016
For #6102 with #6790 applied, I get the following, which seems to correspond to what @fuglede saw in the browser for this issue:
Hainish commentedon Sep 7, 2016
Is there an example of a ruleset which failed tests due to its CA not yet being in our store of certs, but may pass with the newest Firefox store of CAs?
Update certificates to match latest Firefox (fixes EFForg#6569)
Merge pull request #6790 from Hainish/update_certs
fuglede commentedon Sep 11, 2016
Hard to say for sure, but I do not recall ever seeing such an example.