Skip to content

Commit

Permalink
Correctly documentation of Firefox client behavior
Browse files Browse the repository at this point in the history
References:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1846866 ignores pref
- https://bugzilla.mozilla.org/show_bug.cgi?id=1267318 ignores notAfter
- https://bugzilla.mozilla.org/show_bug.cgi?id=1713628 ignores notBefore

"Only end-entity certs can potentially end up here." (in
ERROR_EXPIRED_CERTIFICATE / ERROR_NOT_YET_VALID_CERTIFICATE): verified
locally and also observed before in the armagadd-on-2.0 incident
(https://bugzilla.mozilla.org/show_bug.cgi?id=1548973); if expired
intermediates were accepted, then we would not have had the incident.
  • Loading branch information
Rob--W committed Aug 3, 2023
1 parent 7bc7ab2 commit 5b600a6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
10 changes: 10 additions & 0 deletions autograph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ signers:
# with Firefox, set security.content.signature.root_hash to
# 5E:36:F2:14:DE:82:3F:8B:29:96:89:23:5F:03:41:AC:AF:A0:75:AF:82:CB:4C:D4:30:7C:3D:B3:43:39:2A:FE
#
# NOTE: The above comment is only valid for Firefox <= 102.
# In Firefox 103+ (bug 1769669), roots are hard-coded in Firefox and the
# chosen root is dependent on the app.normandy.api_url pref, see
# https://searchfox.org/mozilla-central/rev/2bf90dc51ce7e8274ce208fbb9d68b3ff535185e/toolkit/components/normandy/lib/NormandyApi.sys.mjs#15-30
#
# Note the private key of the root was not saved. Use tools/genpki to
# make a new config as needed.
- id: normandy
Expand Down Expand Up @@ -130,6 +135,11 @@ signers:
# with Firefox, set security.content.signature.root_hash to
# 5E:36:F2:14:DE:82:3F:8B:29:96:89:23:5F:03:41:AC:AF:A0:75:AF:82:CB:4C:D4:30:7C:3D:B3:43:39:2A:FE
#
# NOTE: The above comment is only valid for Firefox <= 102.
# In Firefox 103+ (bug 1769669), roots are hard-coded in Firefox and the
# chosen root is dependent on multiple conditions, see
# https://searchfox.org/mozilla-central/rev/2bf90dc51ce7e8274ce208fbb9d68b3ff535185e/services/settings/Utils.sys.mjs#53-76,97-101,110-124
#
# Note the private key of the root was not saved. Use tools/genpki to
# make a new config as needed.
- id: remote-settings
Expand Down
5 changes: 1 addition & 4 deletions signer/contentsignature/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ signature:
PEM format, where the first certificate is the end-entity that
issued the signature, and the last certificate is the root of the
PKI. Firefox is configured to only accept signatures from the
internal PKI shared with AMO. This is controlled via the
`security.content.signature.root_hash` preference, where
the value is the hexadecimal of the sha256 of the DER of the root
certificate.
internal PKI shared with AMO.

When Firefox verifies a content signature, it first retrieves the X5U
and checks the signature validity using the end-entity certificate, the
Expand Down
7 changes: 2 additions & 5 deletions signer/contentsignaturepki/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,8 @@ signature:
signature. In practice, this file usually contains three
certificates: the end-entity that issues the content signature, the
intermediate issuer and the root of the Firefox private PKI. Firefox
is configured to only accept signatures from the private PKI, as
controlled via the
`security.content.signature.root_hash` preference, where
the value is the hexadecimal of the sha256 of the DER of the root
certificate.
is configured to only accept signatures from the private PKI, which
is hard-coded in Firefox (https://bugzilla.mozilla.org/1846866).

When Firefox verifies a content signature, it first retrieves the X5U
and checks the signature validity using the end-entity certificate, the
Expand Down
3 changes: 3 additions & 0 deletions signer/xpi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,11 @@ graph LR
VerifyPK7Signature == Extract hash of SF signature file ==> VerifySignature
VerifySignature == Extract Signing Certificate ==> VerifyCertificate
VerifyCertificate == Get Trusted Root ==> BuildCertChain
%% NOTE: Only end-entity certs can potentially end up here. Intermediates/root do not.
BuildCertChain == ERROR_EXPIRED_CERTIFICATE ==> Success
BuildCertChain == ERROR_NOT_YET_VALID_CERTIFICATE ==> Success
Success --> VerifyPK7Signature
%% Expired intermediates/root will reach this state:
BuildCertChain == else ==> Error
Error --> VerifyPK7Signature
end
Expand Down

0 comments on commit 5b600a6

Please sign in to comment.