News for hackers. Stuff that matters.
Re:Announcing the first SHA-1 collision by anilgulecha on Thursday February 23, 2017 @08:27AM (#13713641)
Big things affected:

* DHT/torrent hashes - A group of malicious peers could serve malware for a given hash.

* Git - A commit may be replaced by another without affecting the following commits.

* PGP/GPG -- Any old keys still in use. (New keys do not use SHA1.)

* Distribution software checksum. SHA1 is the most common digest provided (even MD5 for many).

Edit: Yes, I understand this is a collision attack. But yes, it's still a attack vector as 2 same blocks can be generated now, with one published, widely deployed (torrent/git), and then replaced at a later date.

Re:Announcing the first SHA-1 collision by fivesigma on Thursday February 23, 2017 @08:36AM (#13713701)
None of what you mentioned is affected since this is a collision attack. They purposely created 2 files with the same hash.

Creating a file with the same hash as legit file is a preimage attack and is much more difficult to perform (many orders of magnitude more difficult).

This still doesn't mean that SHA-1 isn't dogshit however. It should have been phased out years ago.

Re:Announcing the first SHA-1 collision by mike_hearn on Thursday February 23, 2017 @12:45PM (#13715887)
anilgulecha is correct. Consider the following attack:

You wish to undermine the security of an important codebase managed by git.

You write a valuable and useful contribution to the code. You also create another version of the commit that has the same SHA-1 as the first, which breaks the security of that code.

You submit the first commit, it is accepted and merged.

Now you wait for your target to do a git clone on the repository, perhaps because it's a build environment. You then MITM it (e.g. using infrastructure like QUANTUM INSERT) and redirect the clone to your own git server, which serves the bad commit.

The target compares the top commit hashes of what it expected to get and what it actually got, and is none the wiser. They now compile the code and produce a backdoored binary.

Re:Announcing the first SHA-1 collision by rocqua on Thursday February 23, 2017 @01:35PM (#13716418)
You need enough leeway in the first commit though. As this is a collision attack, you need to be able to tweak both commits in order to get their hashes to collide.

The mangling in the first commit is probably going to look mighty-suspicious. You might be able to handle this if you get to mangle e.g. code comments. In any case, you need something similar like PDFs malleability where you can change one document without the change being noticeable.

Re:Announcing the first SHA-1 collision by euyyn on Thursday February 23, 2017 @02:10PM (#13716751)
Trailing whitespace! :)
Re:Announcing the first SHA-1 collision by Klathmon on Thursday February 23, 2017 @03:38PM (#13717542)
That you of course helpfully fix in the very next commit!
Re:Announcing the first SHA-1 collision by hvidgaard on Thursday February 23, 2017 @08:37AM (#13713710)
It was broken 12 years ago, so no serious software that require cryptographically secure hash functions should use it.
Re:Announcing the first SHA-1 collision by anilgulecha on Thursday February 23, 2017 @08:37AM (#13713708)
Create 2 torrents with the same hash.

Release one into the wild.

Wait.

Infect.

Re:Announcing the first SHA-1 collision by koolba on Thursday February 23, 2017 @08:41AM (#13713744)
Torrents have a tree of hashes for the parts. That allows validating pieces without the entire file (which is also validated at the end).

Probabilistically, the hashes of the parts would not match even if the top level hash matched.

Re:Announcing the first SHA-1 collision by pgeorgi on Thursday February 23, 2017 @08:51AM (#13713807)
You could (try to) collide one of the blocks at the end of the tree. The tree of hashes will still be the same since the hash of the block didn't change.

Then join the torrent with a client that doesn't download but only upload that block (there will be some that will pick it from you). Many legit copies, except for those that were so unlucky to fetch the block from you.

If you manage to build such a block based on one in recurring content (eg. a distributor's logo at the beginning of the file), it could be reused, too.

Re:Announcing the first SHA-1 collision by koolba on Thursday February 23, 2017 @08:54AM (#13713832)
> You could (try to) collide one of the blocks at the end of the tree. The tree of hashes will still be the same since the hash of the block didn't change.

Except you can't do that as this isn't a preimage attack. You can't create an arbitrary bad file matching an existing SHA-1 with this.

Re:Announcing the first SHA-1 collision by Natanael_L on Thursday February 23, 2017 @10:48AM (#13714803)
If you created the original torrent then you can do it
Re:Announcing the first SHA-1 collision by jakeogh on Thursday February 23, 2017 @10:02AM (#13714357)
On the other hand it's useful for denial of service. If you want to disrupt a swarm feeding it bad data is 'good enough'.
Re:Announcing the first SHA-1 collision by koolba on Thursday February 23, 2017 @10:09AM (#13714434)
> On the other hand it's useful for denial of service. If you want to disrupt a swarm feeding it bad data is 'good enough'.

No you can't do that either. Again, this is not a preimage attack: https://en.wikipedia.org/wiki/Preimage_attack

That means you can't use this to match an arbitrary SHA-1. That means you can't use it to generate bad parts of a larger file.

What you're describing is already possible by having clients connect to a swarm, pretend they have parts of a file, and send gibberish. The receiver won't know until they finished downloading the part and hence waste the part-size in download capacity (i.e. DOS). I bet with IPv6 it'd be really easy to have a single malicious client pretend to be a world of swarm members.

Re:Announcing the first SHA-1 collision by jakeogh on Thursday February 23, 2017 @10:11AM (#13714458)
Thanks, so it can gen 2 same size colliding chunks, but it can not take an arb chunk and generate a collision for it. Right?
Re:Announcing the first SHA-1 collision by koolba on Thursday February 23, 2017 @10:18AM (#13714528)
Yes that's my understanding of it. In the PDF example on the site, the file format allows enough tweaking to the raw data without impacting the content to make it feasible.
Re:Announcing the first SHA-1 collision by pgeorgi on Thursday February 23, 2017 @09:08AM (#13713924)
One of the good parts of doing it at the leaf hashes over the top level hash as proposed further up the thread is that quicktime/avi/etc are much more amenable to carrying some "junk" data than trying to figure out two colliding merkle tries with the same hash.
Re:Announcing the first SHA-1 collision by anilgulecha on Thursday February 23, 2017 @08:45AM (#13713766)
The initial torrent metadata is pulled from nothing but the first hash. This is the point where the rest of the data forks.. someone gets the movie, another gets the .exe.
Re:Announcing the first SHA-1 collision by koolba on Thursday February 23, 2017 @08:48AM (#13713790)
That's not an issue with the torrent. That would be with the magnet link format.

Also, and more importantly, this isn't a preimage attack so replacing an existing torrent's SHA-1 hash with a malicious one isn't computational possible.

Re:Announcing the first SHA-1 collision by anilgulecha on Thursday February 23, 2017 @09:39AM (#13714151)
Magnet URI hash is SHA1.

A hash collision can still be used as an attack if you create 2 torrents with the same hash and then distribute.

Re:Announcing the first SHA-1 collision by koolba on Thursday February 23, 2017 @09:54AM (#13714274)
That's not an issue with the torrents. It's an issue with the magnet URI format for referncing torrents.

The "good" torrent would not be susceptible to attack via this receiving the entire torrent file directly (say over HTTPS) is fine.

Re:Announcing the first SHA-1 collision by anilgulecha on Thursday February 23, 2017 @11:01AM (#13714922)
Torrent files have been deprecated for a while. Magnet URI is the the preferred/default method of sharing. TPB did this in 2012[1].

[1] https://torrentfreak.com/the-pirate-bay-dumps-torrents-12022...

Re:Announcing the first SHA-1 collision by koolba on Thursday February 23, 2017 @12:27PM (#13715724)
Looks like it's time to update the magnet link format to use a newer hash.
Re:Announcing the first SHA-1 collision by rakoo on Thursday February 23, 2017 @10:23AM (#13714562)
It's technically true to speak of a tree, but it's less misleading to say it's a list
Re:Announcing the first SHA-1 collision by fivesigma on Thursday February 23, 2017 @08:45AM (#13713765)
This requires the addition of random garbage in the first file which someone will detect anyway. Why not release an infected file with a timebomb malware instead of colliding SHA1? Much cheaper. Still, none of this allows you to attack an already existing torrent.
Re:Announcing the first SHA-1 collision by xiphias on Thursday February 23, 2017 @08:56AM (#13713841)
Nobody will detect if a not important metadata field/asciiart is created/changed randomly, so this is a practical attack.
Re:Announcing the first SHA-1 collision by shemnon42 on Thursday February 23, 2017 @02:58PM (#13717190)
> This requires the addition of random garbage in the first file

Like a third party binary driver?

Re:Announcing the first SHA-1 collision by maxtaco on Thursday February 23, 2017 @08:39AM (#13713730)
PGP V4 key fingerprints still use SHA-1 exclusively. There hasn't been an update to this part of the RFC as far as I know [1]. Collisions where both preimages are of the attacker's choosing matter less in this context, but who knows what clever attacks people can come up with.

[1] https://tools.ietf.org/html/rfc4880#page-71

Re:Announcing the first SHA-1 collision by agentgt on Thursday February 23, 2017 @09:36AM (#13714131)
> * PGP/GPG -- Any old keys still in use. (New keys do not use SHA1.)

> * Distribution software checksum. SHA1 is the most common digest provided (even MD5 for many).

Software distribution seems to be the greatest threat (e.g. a Maven repository or Debian repository).

It still seems like an enormous amount of work. You would have to go after a package with an old PGP key and then I guess go spoof a mirror (most of these guys already use SSL so that is a problem). There are probably easier and far more cost effective attack vectors.

Re:Announcing the first SHA-1 collision by contravariant on Thursday February 23, 2017 @08:39AM (#13713723)
>* Distribution software checksum. SHA1 is the most common digest provided (even MD5 for many).

Maybe I'm mistaken, but isn't the purpose of those mainly to verify that you've downloaded the file correctly? At least, the use of MD5 suggests that this is the case.

Re:Announcing the first SHA-1 collision by anilgulecha on Thursday February 23, 2017 @08:39AM (#13713732)
Correct, and if you have 2 images that have the same hash, you can serve one or the other at different times. This is the attack.
Re:Announcing the first SHA-1 collision by antoinealb on Thursday February 23, 2017 @08:53AM (#13713822)
SHA hashes cannot protect you against the distribution site getting compromised and the hash replaced. That is why most package manager include a form of cryptographic signatures (e.g. Ed25519 for OpenBSD's). SHA and MD5 hashes are just used to protect against accidental corruption, not targeted attacks.
Re:Announcing the first SHA-1 collision by jnwatson on Thursday February 23, 2017 @09:15AM (#13713987)
No. Signatures provide the same amount of integrity protection. In fact, all practical asymmetric signature schemes sign a hash. If an attacker can control what somebody signs, he can switch out signed documents using this vulnerability.
Re:Announcing the first SHA-1 collision by antoinealb on Thursday February 23, 2017 @09:35AM (#13714127)
well I would say that if an attacker controls what you sign, your security model is already toast, isn't it ?
Re:Announcing the first SHA-1 collision by anilgulecha on Thursday February 23, 2017 @09:44AM (#13714193)
Not if you sign with an ideal cryptography hash. (Rather than spend expensive compute on signing the whole message, you create a hash, and sign that.)

The big news here is that SHA1 is now definitively not a cryptographically secure hash.

Re:Announcing the first SHA-1 collision by simias on Thursday February 23, 2017 @09:15AM (#13713980)
You can use SHA for this purpose if you retrieve the hashes from a trusted and secured source.

Buildroot does that for 3rd party packages for instance. It downloads the source from the original website (possibly completely non-secured) but then validates the checksum against a locally trusted hash list. Buildroot supports a variety of hash algorithms but many packages still use SHA-1.

Re:Announcing the first SHA-1 collision by BlackFly on Thursday February 23, 2017 @09:23AM (#13714027)
To be complete, it should be pointed out that the signature techniques you mention are signing not the document itself but a hash of the document. This attack does allow a bait and switch attack on cryptographically signed documents that utilize SHA-1 as the hash.
Re:Announcing the first SHA-1 collision by pgeorgi on Thursday February 23, 2017 @08:53AM (#13713823)
If you can switch between the images, you can also switch hashes. Without a signature they serve _only_ for making sure the network didn't barf into your stream.
Re:Announcing the first SHA-1 collision by StavrosK on Thursday February 23, 2017 @09:03AM (#13713896)
The GP probably means "that it wasn't corrupted during the download", as there are a few attack vectors for someone who could serve a different file (they could trivially serve a different hash).
Re:Announcing the first SHA-1 collision by baq on Thursday February 23, 2017 @08:34AM (#13713690)
i can imagine the torrent thing to be worth the $100k per collision.
Re:Announcing the first SHA-1 collision by qjighap on Thursday February 23, 2017 @08:52AM (#13713810)
You haven't seen my collection of cat pics torrent ;)

Also from a more serious stance the danger is the malware vector or the destruction of the ability to have integrity and not the data in the torrent itself.