Public mode

No access to your tenant or devices. Every item links to its source. What this means

Sources need attention Customize Public modeDiscuss ChangeIntel on Discord

gitoxide does not detect SHA-1 collision attacks

CVSS 3.1 6.8 MEDIUMEUVD CVSS 3.1 6.8 CVSS 3.1 · [email protected] · Secondary 6.8 MEDIUMCVSS_V3 Publisher rating MODERATEFixed by gix-features 0.41.0Fixed by gix-commitgraph 0.27.0Fixed by gix-index 0.39.0Fixed by gix-object 0.48.0CVSS_V3 Fixed by gix-features 0.41.0KEV status unknown

cve-program · CVE-2025-31130

Published

gitoxide is an implementation of git written in Rust. Before 0.42.0, gitoxide uses SHA-1 hash implementations without any collision detection, leaving it vulnerable to hash collision attacks. gitoxide uses the sha1_smol or sha1 crate, both of which implement standard SHA-1 without any mitigations for collision attacks. This means that two distinct Git objects with colliding SHA-1 hashes would break the Git object model and integrity checks when used with gitoxide. This vulnerability is fixed in 0.42.0.

Read the publisher's advisory

euvd · EUVD-2025-9751

Published

gitoxide is an implementation of git written in Rust. Before 0.42.0, gitoxide uses SHA-1 hash implementations without any collision detection, leaving it vulnerable to hash collision attacks. gitoxide uses the sha1_smol or sha1 crate, both of which implement standard SHA-1 without any mitigations for collision attacks. This means that two distinct Git objects with colliding SHA-1 hashes would break the Git object model and integrity checks when used with gitoxide. This vulnerability is fixed in 0.42.0.

Read the publisher's advisory

nvd · CVE-2025-31130

Published

gitoxide is an implementation of git written in Rust. Before 0.42.0, gitoxide uses SHA-1 hash implementations without any collision detection, leaving it vulnerable to hash collision attacks. gitoxide uses the sha1_smol or sha1 crate, both of which implement standard SHA-1 without any mitigations for collision attacks. This means that two distinct Git objects with colliding SHA-1 hashes would break the Git object model and integrity checks when used with gitoxide. This vulnerability is fixed in 0.42.0.

Read the publisher's advisory

osv · GHSA-2frx-2596-x5r6

Published

### Summary gitoxide uses SHA-1 hash implementations without any collision detection, leaving it vulnerable to hash collision attacks. ### Details gitoxide uses the `sha1_smol` or `sha1` crate, both of which implement standard SHA-1 without any mitigations for collision attacks. This means that two distinct Git objects with colliding SHA-1 hashes would break the Git object model and integrity checks when used with gitoxide. The SHA-1 function is considered cryptographically insecure. However, in the wake of the SHAttered attacks, this issue was mitigated in Git 2.13.0 in 2017 by using the [sha1collisiondetection](https://github.com/crmarcstevens/sha1collisiondetection) algorithm by default and producing an error when known SHA-1 collisions are detected. Git is in the process of migrating to using SHA-256 for object hashes, but this has not been rolled out widely yet and gitoxide does not support SHA-256 object hashes. ### PoC The following program demonstrates the problem, using the two [SHAttered PDFs](https://shattered.io/): ```rust use sha1_checked::{CollisionResult, Digest}; fn sha1_oid_of_file(filename: &str) -> gix::ObjectId { let mut hasher = gix::features::hash::hasher(gix::hash::Kind::Sha1); hasher.update(&std::fs::read(filename).unwrap()); gix::ObjectId::Sha1(hasher.digest()) } fn sha1dc_oid_of_file(filename: &str) -> Result<gix::ObjectId, String> { // Matches Git’s behaviour. let mut hasher = sha1_checked::Builder::default().safe_hash(false).build(); hasher.update(&std::fs::read(filename).unwrap()); match hasher.try_finalize() { CollisionResult::Ok(digest) => Ok(gix::ObjectId::Sha1(digest.into())), CollisionResult::Mitigated(_) => unreachable!(), CollisionResult::Collision(digest) => Err(format!( "Collision attack: {}", gix::ObjectId::Sha1(digest.into()).to_hex() )), } } fn main() { dbg!(sha1_oid_of_file("shattered-1.pdf")); dbg!(sha1_oid_of_file("shattered-2.pdf")); dbg!(sha1dc_oid_of_file("shattered-1.pdf")); dbg!(sha1dc_oid_of_file("shattered-2.pdf")); } ``` The output is as follows: ``` [src/main.rs:24:5] sha1_oid_of_file("shattered-1.pdf") = Sha1(38762cf7f55934b34d179ae6a4c80cadccbb7f0a) [src/main.rs:25:5] sha1_oid_of_file("shattered-2.pdf") = Sha1(38762cf7f55934b34d179ae6a4c80cadccbb7f0a) [src/main.rs:26:5] sha1dc_oid_of_file("shattered-1.pdf") = Err( "Collision attack: 38762cf7f55934b34d179ae6a4c80cadccbb7f0a", ) [src/main.rs:27:5] sha1dc_oid_of_file("shattered-2.pdf") = Err( "Collision attack: 38762cf7f55934b34d179ae6a4c80cadccbb7f0a", ) ``` The latter behaviour matches Git. Since the SHAttered PDFs are not in a valid format for Git objects, a direct proof‐of‐concept using higher‐level APIs cannot be immediately demonstrated without significant computational resources. ### Impact An attacker with the ability to mount a collision attack on SHA-1 like the [SHAttered](https://shattered.io/) or [SHA-1 is a Shambles](https://sha-mbles.github.io/) attacks could create two distinct Git objects with the same hash. This is becoming increasingly affordable for well‐resourced attackers, with the Shambles researchers in 2020 estimating $45k for a chosen‐prefix collision or $11k for a classical collision, and projecting less than $10k for a chosen‐prefix collision by 2025. The result could be used to disguise malicious repository contents, or potentially exploit assumptions in the logic of programs using gitoxide to cause further vulnerabilities. This vulnerability affects any user of gitoxide, including `gix-*` library crates, that reads or writes Git objects.

Read the publisher's advisory

osv · RUSTSEC-2025-0021

Published

### Summary gitoxide uses SHA-1 hash implementations without any collision detection, leaving it vulnerable to hash collision attacks. ### Details gitoxide uses the `sha1_smol` or `sha1` crate, both of which implement standard SHA-1 without any mitigations for collision attacks. This means that two distinct Git objects with colliding SHA-1 hashes would break the Git object model and integrity checks when used with gitoxide. The SHA-1 function is considered cryptographically insecure. However, in the wake of the SHAttered attacks, this issue was mitigated in Git 2.13.0 in 2017 by using the [sha1collisiondetection](https://github.com/crmarcstevens/sha1collisiondetection) algorithm by default and producing an error when known SHA-1 collisions are detected. Git is in the process of migrating to using SHA-256 for object hashes, but this has not been rolled out widely yet and gitoxide does not support SHA-256 object hashes. ### PoC The following program demonstrates the problem, using the two [SHAttered PDFs](https://shattered.io/): ```rust use sha1_checked::{CollisionResult, Digest}; fn sha1_oid_of_file(filename: &str) -> gix::ObjectId { let mut hasher = gix::features::hash::hasher(gix::hash::Kind::Sha1); hasher.update(&std::fs::read(filename).unwrap()); gix::ObjectId::Sha1(hasher.digest()) } fn sha1dc_oid_of_file(filename: &str) -> Result<gix::ObjectId, String> { // Matches Git’s behaviour. let mut hasher = sha1_checked::Builder::default().safe_hash(false).build(); hasher.update(&std::fs::read(filename).unwrap()); match hasher.try_finalize() { CollisionResult::Ok(digest) => Ok(gix::ObjectId::Sha1(digest.into())), CollisionResult::Mitigated(_) => unreachable!(), CollisionResult::Collision(digest) => Err(format!( "Collision attack: {}", gix::ObjectId::Sha1(digest.into()).to_hex() )), } } fn main() { dbg!(sha1_oid_of_file("shattered-1.pdf")); dbg!(sha1_oid_of_file("shattered-2.pdf")); dbg!(sha1dc_oid_of_file("shattered-1.pdf")); dbg!(sha1dc_oid_of_file("shattered-2.pdf")); } ``` The output is as follows: ``` [src/main.rs:24:5] sha1_oid_of_file("shattered-1.pdf") = Sha1(38762cf7f55934b34d179ae6a4c80cadccbb7f0a) [src/main.rs:25:5] sha1_oid_of_file("shattered-2.pdf") = Sha1(38762cf7f55934b34d179ae6a4c80cadccbb7f0a) [src/main.rs:26:5] sha1dc_oid_of_file("shattered-1.pdf") = Err( "Collision attack: 38762cf7f55934b34d179ae6a4c80cadccbb7f0a", ) [src/main.rs:27:5] sha1dc_oid_of_file("shattered-2.pdf") = Err( "Collision attack: 38762cf7f55934b34d179ae6a4c80cadccbb7f0a", ) ``` The latter behaviour matches Git. Since the SHAttered PDFs are not in a valid format for Git objects, a direct proof‐of‐concept using higher‐level APIs cannot be immediately demonstrated without significant computational resources. ### Impact An attacker with the ability to mount a collision attack on SHA-1 like the [SHAttered](https://shattered.io/) or [SHA-1 is a Shambles](https://sha-mbles.github.io/) attacks could create two distinct Git objects with the same hash. This is becoming increasingly affordable for well‐resourced attackers, with the Shambles researchers in 2020 estimating $45k for a chosen‐prefix collision or $11k for a classical collision, and projecting less than $10k for a chosen‐prefix collision by 2025. The result could be used to disguise malicious repository contents, or potentially exploit assumptions in the logic of programs using gitoxide to cause further vulnerabilities. This vulnerability affects any user of gitoxide, including `gix-*` library crates, that reads or writes Git objects.

Read the publisher's advisory

Affected versions, risk and source history

cve-program · CVE-2025-31130

Published

gitoxide

Vendor product

Publisher's version information

Shown as published. These rules are not interpreted as NuGet package version ranges.

{
                    "vendor": "GitoxideLabs",
                    "product": "gitoxide",
                    "versions": [
                        {
                            "version": "< 0.42.0",
                            "status": "affected"
                        }
                    ]
                }

Original source record · Cite this exact observation · Complete original publisher JSON

euvd · EUVD-2025-9751

Published

EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON.

Original publisher date fields

datePublished: Apr 4, 2025, 2:41:56 PM

dateUpdated: Jan 23, 2026, 5:08:57 PM

2 related source bulletins · separate from aliases

openSUSE-SU-2025:14994-1: gitoxide-0.42.0-1.1 on GA media

CVE-2025-22620 · CVE-2025-31130

openSUSE-SU-2026:21558-1: Security update for gitoxide

CVE-2024-32650 · CVE-2025-22620 · CVE-2025-31130 · CVE-2026-25541 · CVE-2026-40034

No normalized affected-package data is projected for this source revision. The original publisher record may contain additional product and version evidence; this does not establish that a package is unaffected.

Original source record · Cite this exact observation · Complete original publisher JSON

nvd · CVE-2025-31130

Published

NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON.

Source analysis status: Deferred

Weakness classifications: CWE-328

Original publisher date fields

published: 2025-04-04T15:15:48.320

lastModified: 2026-06-17T09:09:54.553

No normalized affected-package data is projected for this source revision. The original publisher record may contain additional product and version evidence; this does not establish that a package is unaffected.

Original source record · Cite this exact observation · Complete original publisher JSON

osv · GHSA-2frx-2596-x5r6

Published

gix-features

crates.io

SEMVER · introduced 0 → fixed 0.41.0

gix-commitgraph

crates.io

SEMVER · introduced 0 → fixed 0.27.0

gix-index

crates.io

SEMVER · introduced 0 → fixed 0.39.0

gix-object

crates.io

SEMVER · introduced 0 → fixed 0.48.0

gix-odb

crates.io

SEMVER · introduced 0 → fixed 0.68.0

gix-pack

crates.io

SEMVER · introduced 0 → fixed 0.58.0

gitoxide

crates.io

SEMVER · introduced 0 → fixed 0.42.0

gitoxide-core

crates.io

SEMVER · introduced 0 → fixed 0.46.0

gix

crates.io

SEMVER · introduced 0 → fixed 0.71.0

gix-archive

crates.io

SEMVER · introduced 0 → fixed 0.20.0

gix-blame

crates.io

SEMVER · introduced 0 → fixed 0.1.0

gix-config

crates.io

SEMVER · introduced 0 → fixed 0.44.0

gix-diff

crates.io

SEMVER · introduced 0 → fixed 0.51.0

gix-dir

crates.io

SEMVER · introduced 0 → fixed 0.13.0

gix-discover

crates.io

SEMVER · introduced 0 → fixed 0.39.0

gix-filter

crates.io

SEMVER · introduced 0 → fixed 0.18.0

gix-fsck

crates.io

SEMVER · introduced 0 → fixed 0.10.0

gix-merge

crates.io

SEMVER · introduced 0 → fixed 0.4.0

gix-negotiate

crates.io

SEMVER · introduced 0 → fixed 0.19.0

gix-protocol

crates.io

SEMVER · introduced 0 → fixed 0.49.0

gix-ref

crates.io

SEMVER · introduced 0 → fixed 0.51.0

gix-revision

crates.io

SEMVER · introduced 0 → fixed 0.33.0

gix-revwalk

crates.io

SEMVER · introduced 0 → fixed 0.19.0

gix-status

crates.io

SEMVER · introduced 0 → fixed 0.18.0

gix-traverse

crates.io

SEMVER · introduced 0 → fixed 0.45.0

gix-worktree

crates.io

SEMVER · introduced 0 → fixed 0.40.0

gix-worktree-state

crates.io

SEMVER · introduced 0 → fixed 0.18.0

Original source record · Cite this exact observation · Complete original publisher JSON

osv · RUSTSEC-2025-0021

Published

gix-features

crates.io

SEMVER · introduced 0.0.0-0 → fixed 0.41.0

Original source record · Cite this exact observation · Complete original publisher JSON

ChangeIntel

An IT change radar: releases, security, known issues, retirements, documentation changes, and service status from public sources. Every item links to supporting evidence; dates and statuses can change after they are read.

Sources read 16 Nov 07:54 UTC · 270 of 275 readable · 255 fully read · 11 waiting for GitHub's hourly limit · documentation 469/469 current