git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v5 2/4] BreakingChanges: document upcoming change from "sha1" to "sha256"

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 3, 2024, 16:36 UTC
Message-ID
<xmqqfrtu56fo.fsf@gitster.g>
In-Reply-To
<b36ffcbaa67dcdada630e2d582e75da623512743.1717402497.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 57 quoted lines
> Starting with 8e42eb0e9a (doc: sha256 is no longer experimental,
> 2023-07-31), the "sha256" object format is no longer considered to be
> experimental. Furthermore, the SHA-1 hash function is actively
> recommended against by for example NIST and FIPS 140-2, and attacks
> against it are becoming more practical both due to new weaknesses
> (SHAppening, SHAttered, Shambles) and due to the ever-increasing
> computing power. It is only a matter of time before it can be considered
> to be broken completely.
>
> Let's plan for this event by being active instead of waiting for it to
> happend and announce that the default object format is going to change
> from "sha1" to "sha256" with Git 3.0.
>
> All major Git implementations (libgit2, JGit, go-git) support the
> "sha256" object format and are thus prepared for this change. The most
> important missing piece in the puzzle is support in forges. But while
> GitLab recently gained experimental support for the "sha256" object
> format though, to the best of my knowledge GitHub doesn't support it
> yet. Ideally, announcing this upcoming change will encourage forges to
> start building that support.
>
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
>  Documentation/BreakingChanges.txt | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>
> diff --git a/Documentation/BreakingChanges.txt b/Documentation/BreakingChanges.txt
> index ddce7cc301..904857a636 100644
> --- a/Documentation/BreakingChanges.txt
> +++ b/Documentation/BreakingChanges.txt
> @@ -61,6 +61,30 @@ be changed to or replaced in case the alternative was implemented already.
>  
>  === Changes
>  
> +* The default hash function for new repositories will be changed from "sha1"
> +  to "sha256". SHA-1 has been deprecated by NIST in 2011 and is nowadays
> +  recommended against in FIPS 140-2 and similar certifications. Furthermore,
> +  there are practical attacks on SHA-1 that weaken its cryptographic properties:
> ++
> +  ** The SHAppening (2015). The first demonstration of a practical attack
> +     against SHA-1 with 2^57 operations.
> +  ** SHAttered (2017). Generation of two valid PDF files with 2^63 operations.
> +  ** Birthday-Near-Collision (2019). This attack allows for chosen prefix
> +     attacks with 2^68 operations.
> +  ** Shambles (2020). This attack allows for chosen prefix attacks with 2^63
> +     operations.
> ++
> +While we have protections in place against known attacks, it is expected
> +that more attacks against SHA-1 will be found by future research. Paired
> +with the ever-growing capability of hardware, it is only a matter of time
> +before SHA-1 will be considered broken completely. We want to be prepared
> +and will thus change the default hash algorithm to "sha256" for newly
> +initialized repositories.
> ++
> +Cf. <2f5de416-04ba-c23d-1e0b-83bb655829a7@zombino.com>,
> +<20170223155046.e7nxivfwqqoprsqj@LykOS.localdomain>,
> +<CA+EOSBncr=4a4d8n9xS4FNehyebpmX8JiUwCsXD47EQDE+DiUQ@mail.gmail.com>.
A few things we should probably list are:
 - Even if you can locally use SHA-256 in your project and
   push/fetch the history around, public forges may not be ready.
 - The strategy to migrate existing SHA-1 project to SHA-256 without
   going through a flag day change has been designed but not
   implemented or deployed.
 - This is only about the change of the default; we currently have
   no plan to drop support for SHA-1 repositories.

IMHO, we would want each and every item in this document to mention the risk factors that may prevent us from going forward even if we wanted to, and the first item above is an example.

Thanks.
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 43 of 70 in “docs: document upcoming breaking changes”
  1. docs: document upcoming breaking changesPatrick Steinhardt, May 7, 2024
  2. Johannes SchindelinMay 7, 2024
  3. Patrick SteinhardtMay 8, 2024
  4. Junio C HamanoMay 7, 2024
  5. Patrick SteinhardtMay 8, 2024
  6. Junio C HamanoMay 8, 2024
  7. Dragan SimicMay 8, 2024
  8. Patrick SteinhardtMay 10, 2024
  9. Dragan SimicMay 10, 2024
  10. Phillip WoodMay 8, 2024
  11. Patrick SteinhardtMay 8, 2024
  12. Justin ToblerMay 10, 2024
  13. Junio C HamanoMay 10, 2024
  14. Patrick SteinhardtMay 14, 2024
  15. docs: document upcoming breaking changesPatrick Steinhardt, May 14, 2024
  16. Karthik NayakMay 14, 2024
  17. Patrick SteinhardtMay 14, 2024
  18. Junio C HamanoMay 14, 2024
  19. Dragan SimicMay 14, 2024
  20. docs: document upcoming breaking changesPatrick Steinhardt, May 24, 2024
  21. Junio C HamanoMay 24, 2024
  22. Patrick SteinhardtMay 30, 2024
  23. 0/4 docs: document upcoming breaking changesPatrick Steinhardt, May 31, 2024
  24. 1/4 docs: introduce document to announce breaking changesPatrick Steinhardt, May 31, 2024
  25. Junio C HamanoMay 31, 2024
  26. Patrick SteinhardtJun 3, 2024
  27. Junio C HamanoJun 3, 2024
  28. Patrick SteinhardtJun 4, 2024
  29. 2/4 BreakingChanges: document upcoming change from "sha1" to "sha256"Patrick Steinhardt, May 31, 2024
  30. Junio C HamanoMay 31, 2024
  31. 3/4 BreakingChanges: document removal of graftingPatrick Steinhardt, May 31, 2024
  32. 4/4 BreakingChanges: document that we do not plan to deprecate git-checkoutPatrick Steinhardt, May 31, 2024
  33. Junio C HamanoMay 31, 2024
  34. Todd ZullingerMay 31, 2024
  35. Junio C HamanoMay 31, 2024
  36. Patrick SteinhardtMay 31, 2024
  37. 0/4 docs: document upcoming breaking changesPatrick Steinhardt, Jun 3, 2024
  38. 1/4 docs: introduce document to announce breaking changesPatrick Steinhardt, Jun 3, 2024
  39. Phillip WoodJun 3, 2024
  40. Junio C HamanoJun 3, 2024
  41. Patrick SteinhardtJun 4, 2024
  42. 2/4 BreakingChanges: document upcoming change from "sha1" to "sha256"Patrick Steinhardt, Jun 3, 2024
  43. Junio C HamanoJun 3, 2024
  44. Patrick SteinhardtJun 4, 2024
  45. Junio C HamanoJun 4, 2024
  46. 3/4 BreakingChanges: document removal of graftingPatrick Steinhardt, Jun 3, 2024
  47. Junio C HamanoJun 3, 2024
  48. 4/4 BreakingChanges: document that we do not plan to deprecate git-checkoutPatrick Steinhardt, Jun 3, 2024
  49. Junio C HamanoJun 3, 2024
  50. Patrick SteinhardtJun 4, 2024
  51. 0/4 docs: document upcoming breaking changesPatrick Steinhardt, Jun 4, 2024
  52. 1/4 docs: introduce document to announce breaking changesPatrick Steinhardt, Jun 4, 2024
  53. Junio C HamanoJun 4, 2024
  54. Patrick SteinhardtJun 5, 2024
  55. Junio C HamanoJun 5, 2024
  56. Junio C HamanoJun 5, 2024
  57. Patrick SteinhardtJun 6, 2024
  58. 2/4 BreakingChanges: document upcoming change from "sha1" to "sha256"Patrick Steinhardt, Jun 4, 2024
  59. 3/4 BreakingChanges: document removal of graftingPatrick Steinhardt, Jun 4, 2024
  60. Junio C HamanoJun 4, 2024
  61. 4/4 BreakingChanges: document that we do not plan to deprecate git-checkoutPatrick Steinhardt, Jun 4, 2024
  62. Phillip WoodJun 4, 2024
  63. Junio C HamanoJun 4, 2024
  64. Patrick SteinhardtJun 5, 2024
  65. 0/4 docs: document upcoming breaking changesPatrick Steinhardt, Jun 14, 2024
  66. 1/4 docs: introduce document to announce breaking changesPatrick Steinhardt, Jun 14, 2024
  67. Junio C HamanoJun 14, 2024
  68. 2/4 BreakingChanges: document upcoming change from "sha1" to "sha256"Patrick Steinhardt, Jun 14, 2024
  69. 3/4 BreakingChanges: document removal of graftingPatrick Steinhardt, Jun 14, 2024
  70. 4/4 BreakingChanges: document that we do not plan to deprecate git-checkoutPatrick Steinhardt, Jun 14, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.