Closed Bug 1345866 Opened 7 years ago Closed 3 years ago

Windows setup executable digest algorithm should switch away from SHA1

Categories

(Release Engineering :: General, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1531165

People

(Reporter: u570621, Unassigned)

Details

(Keywords: sec-want)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:45.0) Gecko/20100101 Firefox/45.0
Build ID: 20170301181722

Steps to reproduce:

The executable of the windows setup file "Firefox Setup 52.0esr.exe" is still using sha1 digest algorithm instead of the more secure sha256.
Version: 45 Branch → 52 Branch
Group: firefox-core-security → core-security
Component: Untriaged → Other
Flags: needinfo?(bhearsum)
Product: Firefox → Release Engineering
QA Contact: mshal
Version: 52 Branch → unspecified
Flags: needinfo?(bhearsum)
This is expected if you try to download ESR (and now beta and release) using XP or Vista.
Can you also specify the exact URL of the file?
(In reply to Rail Aliiev [:rail] ⌚️ET from comment #1)
> This is expected if you try to download ESR (and now beta and release) using
> XP or Vista.

It looks like this is talking about the digest algorithm (not the certificate). We appear to be using sha1 for that across all branches: https://github.com/mozilla/build-tools/blob/master/lib/python/signing/utils.py#L87

I have a vague memory that we didn't update this when we upgraded the cert because older versions of XP didn't support it. We should probably switch this at least for non-ESR branches now...
From https://bugzilla.mozilla.org/show_bug.cgi?id=1079858#c197:
(In reply to Ben Hearsum (:bhearsum) from comment #197)
> (In reply to Ben Hearsum (:bhearsum) from comment #196)
> > (In reply to Rail Aliiev [:rail] from comment #191)
> > > (In reply to Hector Zhao [:hectorz] from comment #190)
> > > > Maybe this means 43.0.2 is signed as intented?
> > > 
> > > I hope so. Just wanted to double check with Ben who spent a lot of time
> > > digging into all details.
> > 
> > Yes, sha1 digest is expected.
> 
> For anyone concerned, the latest Microsoft document on SHA-1 deprecation
> confirms that SHA-1 digest algorithms are still fine. Quoting from
> http://social.technet.microsoft.com/wiki/contents/articles/32288.windows-
> enforcement-of-authenticode-code-signing-and-timestamping.aspx:
> "Microsoft does not require these file hashes to be done using SHA-2.
> Windows will also not enforce policies on these hashes. If pre-image attacks
> on SHA-1 become feasible we will reevaluate how the system trusts signatures
> made with such file hashes."
It seems pretty clear that we should change the digest type wherever possible. If all versions of Windows we support (including the XP and Vista ones) also support sha256 digests, we can simply change the hardcoding at https://github.com/mozilla/build-tools/blob/master/lib/python/signing/utils.py#L22.

If XP and Vista don't support sha256 digests, we'll need to paramaterize the digest, and add new signing format that uses sha256. Then we can use that everywhere except esr.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Group: core-security
Keywords: sec-want
Summary: Windows setup executable digest algorithm → Windows setup executable digest algorithm should switch away from SHA1
Component: Other → General Automation
QA Contact: mshal → catlee
(In reply to Ben Hearsum (:bhearsum) from comment #5)
> It seems pretty clear that we should change the digest type wherever
> possible. If all versions of Windows we support (including the XP and Vista
> ones) also support sha256 digests, we can simply change the hardcoding at
> https://github.com/mozilla/build-tools/blob/master/lib/python/signing/utils.
> py#L22.
> 
> If XP and Vista don't support sha256 digests, we'll need to paramaterize the
> digest, and add new signing format that uses sha256. Then we can use that
> everywhere except esr.

XP SP2 and Vista SP0 don't support sha256 digests.
(In reply to Masatoshi Kimura [:emk] from comment #6)
> (In reply to Ben Hearsum (:bhearsum) from comment #5)
> > It seems pretty clear that we should change the digest type wherever
> > possible. If all versions of Windows we support (including the XP and Vista
> > ones) also support sha256 digests, we can simply change the hardcoding at
> > https://github.com/mozilla/build-tools/blob/master/lib/python/signing/utils.
> > py#L22.
> > 
> > If XP and Vista don't support sha256 digests, we'll need to paramaterize the
> > digest, and add new signing format that uses sha256. Then we can use that
> > everywhere except esr.
> 
> XP SP2 and Vista SP0 don't support sha256 digests.

We don't support those platforms anymore, except on ESR52.
(In reply to Ben Hearsum (:bhearsum) from comment #7)
> (In reply to Masatoshi Kimura [:emk] from comment #6)
> > (In reply to Ben Hearsum (:bhearsum) from comment #5)
> > > It seems pretty clear that we should change the digest type wherever
> > > possible. If all versions of Windows we support (including the XP and Vista
> > > ones) also support sha256 digests, we can simply change the hardcoding at
> > > https://github.com/mozilla/build-tools/blob/master/lib/python/signing/utils.
> > > py#L22.
> > > 
> > > If XP and Vista don't support sha256 digests, we'll need to paramaterize the
> > > digest, and add new signing format that uses sha256. Then we can use that
> > > everywhere except esr.
> > 
> > XP SP2 and Vista SP0 don't support sha256 digests.
> 
> We don't support those platforms anymore, except on ESR52.

Then why did you care about sha256 digests support on XP and Vista?
(In reply to Masatoshi Kimura [:emk] from comment #8)
> (In reply to Ben Hearsum (:bhearsum) from comment #7)
> > (In reply to Masatoshi Kimura [:emk] from comment #6)
> > > (In reply to Ben Hearsum (:bhearsum) from comment #5)
> > > > It seems pretty clear that we should change the digest type wherever
> > > > possible. If all versions of Windows we support (including the XP and Vista
> > > > ones) also support sha256 digests, we can simply change the hardcoding at
> > > > https://github.com/mozilla/build-tools/blob/master/lib/python/signing/utils.
> > > > py#L22.
> > > > 
> > > > If XP and Vista don't support sha256 digests, we'll need to paramaterize the
> > > > digest, and add new signing format that uses sha256. Then we can use that
> > > > everywhere except esr.
> > > 
> > > XP SP2 and Vista SP0 don't support sha256 digests.
> > 
> > We don't support those platforms anymore, except on ESR52.
> 
> Then why did you care about sha256 digests support on XP and Vista?

Oh, I'm sorry, I should've read the full context before replying. Thank you for the confirmation on what those platforms support. We do care, because we need to make sure we don't break signing on ESR52.

So, if we fix this bug while ESR52 still exists we'll need to make the digest configurable, and continue to use sha1 esr52. If we don't fix this until ESR52 dies, we can just switch the hardcoding, I guess.
Priority: -- → P3
Component: General Automation → General
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.