GNU bug report logs - #25999
SHA1SUM: please switch to sha1dc to warn of attempted hash collision attacks

Previous Next

Package: coreutils;

Reported by: Henrique de Moraes Holschuh <hmh <at> debian.org>

Date: Mon, 6 Mar 2017 15:17:01 UTC

Severity: wishlist

To reply to this bug, email your comments to 25999 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#25999; Package coreutils. (Mon, 06 Mar 2017 15:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Henrique de Moraes Holschuh <hmh <at> debian.org>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Mon, 06 Mar 2017 15:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Henrique de Moraes Holschuh <hmh <at> debian.org>
To: bug-coreutils <at> gnu.org
Subject: SHA1SUM: please switch to sha1dc to warn of attempted hash collision
 attacks
Date: Mon, 06 Mar 2017 12:16:14 -0300
This is a feature request, in light of the "shattered" attack against
SHA-1[1] published by Google.

A drop-in replacement for sha1 exists, based on the concept of
counter-cryptanalysis[2].  This drop-in replacement can detect when the
SHA-1 hash hits the weakened internal states used by the shattered
attack.  Optionally, it can also negate the
collision-resistance-weakening effect of the "shattered" attack.

This "hardened sha1" drop-in replacement is called sha1dc (for collision
detection), and an implementation can be found at:

https://github.com/cr-marcstevens/sha1collisiondetection

The license for the sha1-dc library is MIT.   Other noteworthy users of
sha1dc are the git scm, which will use it to _detect_ objects weakened
for easier collisions, and refuse such objects.  This new version of git
has not been released yet at the time I am writing this bug report, but
the relevant patches are already in git's "pu" branch.

It would be nice if coreutils' sha1sum would use sha1dc, and report
(either as a warning, or as an error) when an attempt at generating SHA1
collisions is detected.

Note that this feature request is not for sha1sum to switch to the
hardened "safe version" of sha1dc that defuses the collision attempts,
but rather that sha1dc be used to detect and warn the user about the
specially crafted input data that makes the "shattered" attack feasible.

I have no strong opinions on whether sha1sum should abort or just warn
when an attempted collision is detected.  I also have no strong opinions
whether it should use "safe mode" or not, as long as it *does* warn the
user when an attempted collision is detected... only, I feel "safe mode"
behavior should be optional (I have no strong opinions on whether it
should be enabled by default or not).

[1] https://shattered.it/
[2] http://eprint.iacr.org/2017/173/20170228:105224

-- 
  Henrique de Moraes Holschuh <hmh <at> debian.org>




Information forwarded to bug-coreutils <at> gnu.org:
bug#25999; Package coreutils. (Tue, 07 Mar 2017 04:46:02 GMT) Full text and rfc822 format available.

Message #8 received at 25999 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Henrique de Moraes Holschuh <hmh <at> debian.org>, 25999 <at> debbugs.gnu.org
Subject: Re: bug#25999: SHA1SUM: please switch to sha1dc to warn of attempted
 hash collision attacks
Date: Mon, 6 Mar 2017 20:45:11 -0800
On 06/03/17 07:16, Henrique de Moraes Holschuh wrote:
> This is a feature request, in light of the "shattered" attack against
> SHA-1[1] published by Google.
> 
> A drop-in replacement for sha1 exists, based on the concept of
> counter-cryptanalysis[2].  This drop-in replacement can detect when the
> SHA-1 hash hits the weakened internal states used by the shattered
> attack.  Optionally, it can also negate the
> collision-resistance-weakening effect of the "shattered" attack.
> 
> This "hardened sha1" drop-in replacement is called sha1dc (for collision
> detection), and an implementation can be found at:
> 
> https://github.com/cr-marcstevens/sha1collisiondetection
> 
> The license for the sha1-dc library is MIT.   Other noteworthy users of
> sha1dc are the git scm, which will use it to _detect_ objects weakened
> for easier collisions, and refuse such objects.  This new version of git
> has not been released yet at the time I am writing this bug report, but
> the relevant patches are already in git's "pu" branch.
> 
> It would be nice if coreutils' sha1sum would use sha1dc, and report
> (either as a warning, or as an error) when an attempt at generating SHA1
> collisions is detected.
> 
> Note that this feature request is not for sha1sum to switch to the
> hardened "safe version" of sha1dc that defuses the collision attempts,
> but rather that sha1dc be used to detect and warn the user about the
> specially crafted input data that makes the "shattered" attack feasible.
> 
> I have no strong opinions on whether sha1sum should abort or just warn
> when an attempted collision is detected.  I also have no strong opinions
> whether it should use "safe mode" or not, as long as it *does* warn the
> user when an attempted collision is detected... only, I feel "safe mode"
> behavior should be optional (I have no strong opinions on whether it
> should be enabled by default or not).
> 
> [1] https://shattered.it/
> [2] http://eprint.iacr.org/2017/173/20170228:105224
> 

Interesting.

I agree the "safe version" is less interesting as one
can use sha3 or blake2 with the same length as sha1,
for about the same compatibility but greater protection.

As for detection, I suppose we should by default
enable this with sha1sum --check, because:
 - sha1sum should be as safe as possible by default
 - we don't care that much about sha1 perf since it's deprecated
 - false positive probability is smaller than 2^-90

I wonder is there similar analysis possible with md5sum?

As for licensing, we could probably integrate it as
we do already for src/blake2/

thanks,
Pádraig




Severity set to 'wishlist' from 'normal' Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 29 Oct 2018 02:53:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#25999; Package coreutils. (Sun, 08 May 2022 20:20:02 GMT) Full text and rfc822 format available.

Message #13 received at 25999 <at> debbugs.gnu.org (full text, mbox):

From: Christoph Anton Mitterer <calestyo <at> scientia.org>
To: 25999 <at> debbugs.gnu.org
Subject: Re: SHA1SUM: please switch to sha1dc to warn of attempted hash
 collision attacks
Date: Sun, 08 May 2022 22:19:21 +0200
Hey.

Is this still being considered?

Thanks,
Chris.




Information forwarded to bug-coreutils <at> gnu.org:
bug#25999; Package coreutils. (Mon, 09 May 2022 13:18:01 GMT) Full text and rfc822 format available.

Message #16 received at 25999 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Christoph Anton Mitterer <calestyo <at> scientia.org>, 25999 <at> debbugs.gnu.org
Subject: Re: bug#25999: SHA1SUM: please switch to sha1dc to warn of attempted
 hash collision attacks
Date: Mon, 9 May 2022 14:16:53 +0100
On 08/05/2022 21:19, Christoph Anton Mitterer wrote:
> Hey.
> 
> Is this still being considered?

Yes it still does make sense,
especially as sha1 becomes less popular over time,
in which case the extra processing would matter less.

thanks,
Pádraig





This bug report was last modified 3 years and 100 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.