|
|
[Gentoo Linux Home] [GLEP Index] [GLEP Source] |
| GLEP: | 59 |
|---|---|
| Title: | Manifest2 hash policies and security implications |
| Version: | 1.9 |
| Last-Modified: | 2010/04/07 21:34:24 |
| Author: | Robin Hugh Johnson <robbat2 at gentoo.org>, |
| Status: | Draft |
| Type: | Standards Track |
| Content-Type: | text/x-rst |
| Requires: | 44 |
| Created: | October 2006 |
| Updated: | November 2007, June 2008, July 2008, October 2008, January 2010 |
| Updates: | 44 |
| Post-History: | December 2009, January 2010 |
Contents
While Manifest2 format allows multiple hashes, the question of which checksums should be present, why, and the security implications of such have never been resolved. This GLEP covers all of these issues, and makes recommendations as to how to handle checksums both now, and in future.
This GLEP is being written as part of the work on signing the Portage tree, but is only tangentially related to the actual signing of Manifests. Checksums present one possible weak point in the overall security of the tree - and a comprehensive security plan is needed.
This GLEP is not mandatory for the tree-signing specification, but instead aims to improve the security of the hashes used in Manifest2 [GLEP44]. As such, it is also able to stand on it's own.
First of all, I'd like to cover the bad news in checksum security. A much discussed point, as been the simple question: What is the security of multiple independent checksums on the same data? The most common position (and indeed the one previously held by myself), is that multiple checksums would be an increase in security, but we could not provably quantify the amount of security this added. The really bad news, is that this position is completely and utterly wrong. Many of you will be aghast at this. There is extremely little added security in multiple checksums as noted by Joux [J04]. For any set of checksums, the actual strength lies in that of the strongest checksum.
Wang et al [W04] extended Joux's [J04] work on SHA-0 to cover MD4, MD5, HAVAL-128 and RIPEMD families of hashes.
For a general collision, not a pre-image attack, since the announcement by Wang et al [W04], the time required to break MD5 has been massively reduced. Originally at 1 hour on a near-supercomputer (IBM P690) and estimated at 64 hours with a Pentium-3 1.7Ghz. This has gone down to less than in two years, to 17 seconds [K06a].
If we accept a factor of 800x as a sample of how much faster a checksum may be broken over the course of 2 years (MD5 using the above data is >2000x), then existing checksums do not stand a significant chance of survival in the future. We should thus accept that whatever checksums we are using today, will be broken in the near future, and plan as best as possible. (A brief review [H04] of the SHA1 attacks indicates an improvement of ~600x in the same timespan).
And for those that claim implementation of these procedures is not yet feasible, see [K06b] for an application that can produce two self-extracting EXE files, with identical MD5s, and whatever payload you want.
Of the checksums presently used by Manifest2 (SHA1, SHA256, RIPEMD160), one stands close to being completely broken: SHA1; and another is significantly weakened: RIPEMD160. The SHA2 series has suffered some attacks, but still remains reasonably solid [G07],[K08].
To reduce the potential for future problems and any single checksum break leading to a rapid decrease in security, we should incorporate the strongest hash available from each family of checksums, and be prepared to retire old checksums actively, unless there is a overriding reason to keep a specific checksum, such as part of a migration plan.
Portage should always try to verify all supported hashes that are available in a Manifest2, starting with the strongest ones as maintained by a preference list. Over time, the weaker checksums should be removed from Manifest2 files, once all old Portage installations have had sufficient time to upgrade. Stronger checksums shall be added as soon as an implementation is available in Portage. Weak checksums may be removed as long as the depreciation process is followed (see below).
As soon as feasible, we should add the SHA512 and WHIRLPOOL algorithms. In future, as stream-based checksums are developed (in response to the development by NIST [AHS]), they should be considered and used.
The SHA512 algorithm is available in Python 2.5, which has been a dependency of Portage since approximately Portage 2.1.6.13.
The WHIRLPOOL checksum is not available within the PyCrypto library or hashlib that is part of Python 2.5, but there are multiple alternative Python implementations available, ranging from pure Python to C-based (python-mhash).
The existence unsupported hash is not considered to be a failure unless no supported hashes are available for a given Manifest entry.
A minimum set of depreciated checksums shall be maintained only to support old package manager versions where needed by historically used trees:
For the current Portage, both SHA1 and RIPEMD160 should be immediately removed, as they present no advantages over the already present SHA256. SHA256 cannot be replaced immediately with SHA512, as existing Portage versions need at least one supported algorithm present (SHA256 support was added in June 2006), so it must be retained for some while.
Immediately:
After the majority of Portage installations include SHA512 support:
Old versions of Portage may support and expect only specific checksums. This is accounted for in the checksum depreciation discussion.
For maximum compatiability, we should only have to include each of the old algorithms that we are officially still supporting, as well as the new ones that we prefer.
| [GLEP44] | Mauch, M. (2005) GLEP44 - Manifest2 format. http://www.gentoo.org/proj/en/glep/glep-0044.html |
Copyright (c) 2006-2010 by Robin Hugh Johnson. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0.