8 ms·
Microsoft is Abandoning SHA-1 Hashes for Updates
- greenyoda 8y agoNote: This article was written by Steve Bellovin, a leading researcher in security and networking.
- deleted 8y ago[deleted]
- techntoke 8y agoI think it would be quite the day to take the hashes of Microsoft's ISO images for Windows, and compare it with the source code to check if there is government backdoors in the code.
- leeoniya 8y agoyou can't even do that with their open source VSCode, since they add in branding/telemetry/licensing to the actual binaries they distribute. so you have forks that strip it out: https://github.com/VSCodium/vscodium https://github.com/VSCodium/vscodium
- craftyguy 8y ago> I think it would be quite the day to take the hashes of Microsoft's ISO images for Windows, and compare it with the source code Wat? How would you translate an ISO hash into anything meaningful to compare to the actual source code (that you don't have access to, but that's beside the point) ? Does microsoft enforce reproducible builds[0]? Even if they did, you couldn't reproduce it (no access to source). When you hash a large binary, like an ISO, you cannot deconstruct what, eh, sub-binaries it is made of, and you cannot magically decompile those, eh, sub-binaries into source code. 0. https://wiki.debian.org/ReproducibleBuilds https://wiki.debian.org/ReproducibleBuilds
- techntoke 8y agoYes, you can take a look at the source code and recompile the ISO to match the hash. If the compiled ISO hash doesn't match, then it isn't the same code.
- craftyguy 8y agoNo, you can literally do none of that with microsoft software.
- anticensor 8y agoMicrosoft enforces reproducible builds since 2017.
- craftyguy 8y agoDo you have a source for that (no pun intended)? Even if they did, it's impossible for anyone outside of microsoft to verify because, well, it's proprietary. So for those of us who trust microsoft as far as we can throw them, it doesn't really do much.
- deleted 8y ago[deleted]
- anticensor 8y agoYes, see https://blogs.msdn.microsoft.com/oldnewthing/20180103-00/?p=97705 https://blogs.msdn.microsoft.com/oldnewthing/20180103-00/?p=... by Raymond Chen.
- TickleSteve 8y agoThats not how backdoors work. Backdoors are subtle bugs introduced into the existing codebase. They are compiled into the build. They aren't added to the binary after the compilation by a malicious third party.
- bigiain 8y agoI'm not sure the term "backdoor" is that well defined. In Ken Thompson's "Reflections On Trusting Trust" Turing award lecture from 1984, he talked about "trojan horses" being inserted into the compiler in such a way that any code run through the compiler results in a program that has behaviour which is unable to be determined from examining the source code. They are "compiled into the build" by a malicious _compiler_, not from malicious bugs introduced into the source code. It's quite obvious that such behaviours could easily be things which deserve the name "backdoor". (It's only short, and _well_ worth the time needed to read it if you haven't come across it before: https://www.archive.ece.cmu.edu/~ganger/712.fall02/papers/p761-thompson.pdf https://www.archive.ece.cmu.edu/~ganger/712.fall02/papers/p7... )
- subjoriented 8y agoIt's just good housekeeping at this point. Attacks never get worse, and there have been structural problems with SHA-1 for a long time. Plus, it does make sense for a company like Microsoft with a large user base to protect against malicious insiders. While I was there, employees in the Patch Tuesday program had been approached about backdooring updates. I don't think creating a colliding update would necessarily be the vector for such a thing (and removing SHA-1 doesn't necessarily protect against it) but overall its just a good idea.
- JoshTriplett 8y ago> While I was there, employees in the Patch Tuesday program had been approached about backdooring updates. What was the general policy about working with law enforcement to prosecute such attempts, to the extent they were traceable?
- subjoriented 8y agoMicrosoft had a large amount of policy, and it could be that there were some policy that applied, but if there was some it didn't permeate the culture and daily routine in the trenches there (from my personal and limited experience). Both backdoor requests I became privy to while there (2.5 years, circa 2011-2014) came from a certain US TLA, were law enforcement would have been an awkward step, though it seems reasonable to me that there were more requests, including from other organizations, but I was never made aware of those. There were some foreign spies caught in MSRC in the same timeframe. More of an extradite than a prosecute type situation, though.
- foobandit 8y agoThat's significant information, is this something you should be speaking about publicly?
- tiff_seattle 8y agoMaybe this guy? https://www.theatlantic.com/international/archive/2010/07/who-was-the-12th-russian-spy-at-microsoft/344876/ https://www.theatlantic.com/international/archive/2010/07/wh...
- tedunangst 8y ago> However, given an existing file and hence its hash, it is not possible, as far as anyone knows, to generate a second file with that same hash. This attack, called a "pre-image attack", is far more serious. (There's a third type of attack, a "second pre-image attack", which I won't go into.) I think the attack just described is the second pre-image attack. The second file is the second pre-image. A pre-image attack would be to start with only the hash, no file, and create a file with that hash.
- Moodles 8y agoCorrect. You're right, the article is mistaken.
- jtaft 8y ago>However, given an existing file and hence its hash, it is not possible, as far as anyone knows, to generate a second file with that same hash. Interesting...I thought google did exactly this in 2017. Although, they controlled the PDF prefix. https://security.googleblog.com/2017/02/announcing-first-sha1-collision.html https://security.googleblog.com/2017/02/announcing-first-sha...
- geofft 8y agoYeah, this is the difference between a collision and a preimage attack. A collision is, given a hash function, come up with two documents with the same hash, but you can control both documents. A preimage attack is, given a hash function and one document (or one hash), find another document with the same hash. That's much harder - you don't have the ability to force the algorithm's internal state into something convenient. A preimage attack is what you worry about if you think the person giving you the signature might be untrustworthy, e.g., they're currently promising one thing but they might swap it out with something else later. A collision attack is what you worry about even if you don't think the person giving you the signature is untrustworthy and you're expecting someone else to swap out the document before it gets to you. So there are a good handful of scenarios where you don't care about preimage attacks but you do care about collisions - e.g., if Microsoft is signing Windows Update files, presumably they don't need to conduct a preimage attack to send you a malicious update, they can just directly sign a malicious update. But you don't want other people sending you malicious updates that appear to be signed by Microsoft.
- xpaulbettsx 8y agoI think that the more likely reason is that many corporate security standards (think PCI compliance etc etc) are starting to blanket ban SHA-1, and it was cheaper to switch away from it than continue having to carve out policy exceptions with their large customers who are on support contracts for Win7
- est31 8y agoIf there is no Win7 support for SHA-2, why can't they add just add support for it?
- kfwhp 8y agoBecause they don't want people using 7 anymore I guess?
- mysterydip 8y agoThey are: https://www.pcmag.com/news/366610/still-using-windows-7-microsofts-next-update-is-critical https://www.pcmag.com/news/366610/still-using-windows-7-micr...
- qwerty456127 8y agoIsn't Blake2 the best hash function? If yes why won't everybody just switch to it?
- lawn 8y agoBecause the different hash functions have different trade-offs. For example not all hash functions are cryptographic hash functions and can be much faster.
- cm2187 8y agoAlso aren’t SHAx hardware accelerated on x86 cpus?
- blattimwind 8y agoOnly SHA-1 and SHA-2 and only on current-gen Intel CPUs or all AMD Ryzen CPUs.
- zaarn 8y agoBlake2 is a cryptographic hash though and for updates it's also fairly fast on most systems, comparable with SHA2, so it shouldn't be a problem.
- mjevans 8y agoProbably because it isn't officially sanctioned, which apparently was the reason the more common libcs never added support for bcrypt directly. - "The security departments of some customers look at recommendations they get and evaluate the deployed systems based on this. In a few places this led to the problem that the NIST warns people indiscriminately about the use of MD5..." (Note, this was from 2007 when md5 would be in roughly the same state that sha1 is now in.) http://www.akkadia.org/drepper/sha-crypt.html http://www.akkadia.org/drepper/sha-crypt.html https://access.redhat.com/articles/1519843#ok-ok-but-why-not-bcrypt-5 https://access.redhat.com/articles/1519843#ok-ok-but-why-not...
- simias 8y agoSHA-2 is more widely supported and the de-facto standard these days. I'm not surprised that an entity like Microsoft ends up being conservative with its choices of algorithms. I guess they could've gone for SHA-3 but I suppose even that is a bit too "bleeding edge" for MS.
- vxNsr 8y agoThe ars link is a little more detailed, specifically it points out that SHA-1 will be replaced with SHA-2, something the current article fails to mention, I was left very confused about what microsoft would be actually doing.
- dang 8y agoThat article is https://arstechnica.com/gadgets/2019/02/mandatory-update-coming-to-windows-7-2008-to-kill-off-weak-update-hashes/ https://arstechnica.com/gadgets/2019/02/mandatory-update-com....
- theandrewbailey 8y agoAgreed. This article led me to believe that there won't be any hashing/signing/protection at all for these updates, until I read the Ars article.
- metaphor 8y agoHistorically, NIST had provided transition guidance to Federal agencies circa March 2006 to begin migrating to SHA-2[1], officially deprecated SHA-1 for digital signature generation use between 2011 and 2013[2], and outright disallowed it with exception for the same circa November 2015[3]. FWIW, the memo from the horse's mouth[4]: > To protect your security, Windows operating system updates are dual-signed using both the SHA-1 and SHA-2 hash algorithms to authenticate that updates come directly from Microsoft and were not tampered with during delivery. Due to weaknesses in the SHA-1 algorithm and to align to industry standards Microsoft will only sign Windows updates using the more secure SHA-2 algorithm exclusively. I'd imagine orchestrating this push is a real cluster. Would be interesting hear perspective from the inside. [1] https://csrc.nist.gov/projects/hash-functions/nist-policy-on-hash-functions https://csrc.nist.gov/projects/hash-functions/nist-policy-on... [2] https://doi.org/10.6028/NIST.SP.800-131A https://doi.org/10.6028/NIST.SP.800-131A [3] https://doi.org/10.6028/NIST.SP.800-131Ar1 https://doi.org/10.6028/NIST.SP.800-131Ar1 [4] https://support.microsoft.com/en-us/help/4472027/2019-sha-2-code-signing-support-requirement-for-windows-and-wsus https://support.microsoft.com/en-us/help/4472027/2019-sha-2-...
- dspillett 8y ago> updates are dual-signed using both the SHA-1 and SHA-2 hash algorithms > Due to weaknesses ... and ... industry standards Microsoft will only sign Windows updates using the more secure SHA-2 algorithm exclusively. This seems like a half step to me. I assume the used both as a transitional process: use both until all consumers of the signed content support the better, then drop the older standard. I wonder why they've not done the same and replaced SHA-1 with a more recent algorithm, so they can easily deprecate SHA-2 if/when needed at a later date? All the code and processes already support multiple hashes/signatures so that wouldn't be a problem. Or is the next accepted standard not yet fully decided yet? Or do they think SHA-2 will last long enough that SHA-3 (assuming that is the generally accepted next step) will be supplanted at least once before SHA-2 needs deprecating so there is no point implementing that now?
- blattimwind 8y ago> SHA-3 (assuming that is the generally accepted next step) That's just the thing, SHA-3 isn't the generally accepted successor to SHA-2. The "go to" hash function is still SHA-2, or BLAKE2.
- anticensor 8y agoWhy not replace it by MD-6?
- Someone1234 8y agoMD-6 never gained popularity and was eliminated early in the SHA-3 competition since it lacked proofs that it could resist differential attacks. Microsoft are quite correct to use SHA-2 (conservative choice) but SHA-3 would also be fine. Bringing up MD-6 at all seems arbitrary.
- blazespin 8y agoLikely it's just a compliance thing. remove sha-1 and you can stop explaining it all the time to auditors why it's there.
- londons_explore 8y agoI hope they put effort into making sure the user experience for those who don't install the update in time is reasonable. When I did dads old laptop out of the attic and boot it up, I don't want to be faced with the inability to install new updates. At least make an error message that points to a help article saying how to resolve the issue.
- londons_explore 8y agoI might not be understanding this right... But can't they dual sign with both SHA1 and SHA2 with no loss of functionality? New clients would use (and require) the SHA2 hash. Old clients could still use the SHA1 hash, but with the risk of a faked update, but that's probably still better than no update.
- __s 8y agohttps://news.ycombinator.com/item?id=19206527 https://news.ycombinator.com/item?id=19206527 Sounds like they were already dual signing, & are now phasing out SHA1. Only as secure as the weakest signature you accept
- userbinator 8y agoBut can't they dual sign with both SHA1 and SHA2 with no loss of functionality? Furthermore, wouldn't trying to collide both SHA2 and SHA1 be even more close to impossible than just trying to collide SHA2 (which is already currently regarded as practically impossible)? Perhaps newer clients should verify both hashes?
- tialaramex 8y agoNo. Amateurs bring this up _all the time_. Depending on exactly what's going on, it may be no harder to attack _both_ than just the hardest of the two component hashes, plus you just wasted a bunch of effort and maybe introduced extra security bugs with your extra complexity. So don't do this. The compatibility argument makes sense, but the "maybe it's safer" argument doesn't have any traction at all. And the politics always ends up being "We don't want to endorse this unsafe thing, let's just remove it".
- userbinator 8y agoDepending on exactly what's going on, it may be no harder to attack _both_ than just the hardest of the two component hashes We have seen published collisions for MD5 (which are incidentally nearly trivial to generate these days), and I'm aware of the one for SHA-1 (which took much longer to generate) --- but have there been any dual-collisions found? According to you, they wouldn't be that hard to generate, but I haven't been able to find any examples of dual collisions, even for trivially-collidable-by-themselves combinations like MD5+MD4.
- avar 8y agoFor those who are paranoid, but can't move away from SHA-1 for whatever reason, consider using SHA-1DC. It's compatible with SHA-1, but will barf on the known collision attack against SHA-1: https://github.com/cr-marcstevens/sha1collisiondetection https://github.com/cr-marcstevens/sha1collisiondetection It's what Git uses by default, of course there's no guarantee that new SHA-1 attacks won't be discovered, but it's better than nothing.
- tialaramex 8y agoTo be clear, what this is doing is _markedly more sophisticated_ than just comparing to a fixed hash we know is bad and rejecting it, and so "new SHA-1 attacks" would likely actually still trip this. The idea in all these MD-family (which SHA1 and SHA2 are members of) collisions is the same, using one or two input blocks you trap the hash function in an awkward place so that fewer state bits than normal matter, and then skewered in this way you calculate one final block that will collide it. The SHA-1DC is watching for that situation which its developers call a "disturbance vector" and so it will detect all attacks based on the same approach and "fix" the hash at a small CPU premium for all hashes. We know for MD5 that independent (presumably nation state given the costs) elements did a similar but different attack that we only found out about after the published MD5 collision - but it trips the same detection (for MD5 in that case) because it's based on the same mathematical approach, even though none of the actual hash values involved were the same. A defence of this sort would have worked, even against an adversary with nation state resources (in this case probably Israel or the US).
- avar 8y agoAll true, thanks for the elaboration. The only minor thing I'll add is that while its default mode of operation is to munge its internal state when detecting such colliding data and returning a hash that's not the same as what stock SHA-1 would return, it can also be made to just return an error. That's the mode Git uses it in: https://github.com/git/git/blob/v2.21.0-rc2/sha1dc_git.c#L10-L22 https://github.com/git/git/blob/v2.21.0-rc2/sha1dc_git.c#L10...
- OnlyRepliesToBS 8y agoms uses sha1 hashes for updates