This project might be open to known security vulnerabilities, which can be prevented by tightening the version range of affected dependencies. Find detailed information at the bottom.

Crate cargo

Dependencies

(70 total, 25 outdated, 6 possibly insecure)

CrateRequiredLatestStatus
 anstream^0.6.51.0.0out of date
 anstyle^1.0.41.0.14up to date
 anyhow^1.0.751.0.102up to date
 base64^0.21.50.22.1out of date
 bytesize^1.32.3.1out of date
 cargo-credential^0.4.20.4.10up to date
 cargo-credential-libsecret^0.4.20.5.6out of date
 cargo-credential-macos-keychain^0.4.20.4.21up to date
 cargo-credential-wincred^0.4.20.4.21up to date
 cargo-platform^0.1.40.3.3out of date
 cargo-util^0.2.60.2.28up to date
 clap^4.4.104.6.1up to date
 color-print^0.3.50.3.7up to date
 crates-io^0.39.00.40.18out of date
 curl^0.4.440.4.49up to date
 curl-sys^0.4.700.4.88+curl-8.20.0up to date
 filetime^0.2.220.2.27up to date
 flate2^1.0.281.1.9up to date
 git2^0.18.10.20.4out of date
 git2-curl^0.19.00.21.0out of date
 gix^0.56.00.83.0out of date
 gix-features ⚠️^0.35.00.48.0out of date
 glob^0.3.10.3.3up to date
 hex^0.4.30.4.3up to date
 hmac^0.12.10.13.0out of date
 home^0.5.50.5.12up to date
 http-auth^0.1.80.1.10up to date
 humantime^2.1.02.3.0up to date
 ignore^0.4.210.4.25up to date
 im-rc^15.1.015.1.0up to date
 indexmap^22.14.0up to date
 itertools^0.12.00.14.0out of date
 jobserver^0.1.270.1.34up to date
 lazycell^1.3.01.3.0up to date
 libc^0.2.1500.2.186up to date
 libgit2-sys ⚠️^0.16.10.18.3+1.9.2out of date
 memchr^2.6.42.8.0up to date
 opener^0.6.10.8.4out of date
 openssl ⚠️^0.10.570.10.79maybe insecure
 os_info^3.7.03.14.0up to date
 pasetors^0.6.70.7.8out of date
 pathdiff^0.20.2.3up to date
 pulldown-cmark^0.9.30.13.3out of date
 rand^0.8.50.10.1out of date
 regex^1.10.21.12.3up to date
 rusqlite^0.30.00.39.0out of date
 rustfix^0.7.00.9.5out of date
 semver^1.0.201.0.28up to date
 serde^1.0.1931.0.228up to date
 serde-untagged^0.1.10.1.9up to date
 serde-value^0.7.00.7.0up to date
 serde_ignored^0.1.90.1.14up to date
 serde_json^1.0.1081.0.149up to date
 sha1^0.10.60.11.0out of date
 shell-escape^0.1.50.1.5up to date
 supports-hyperlinks^2.1.03.2.0out of date
 syn^2.0.392.0.117up to date
 tar ⚠️^0.4.400.4.45maybe insecure
 tempfile^3.8.13.27.0up to date
 time ⚠️^0.30.3.47maybe insecure
 toml^0.8.81.1.2+spec-1.1.0out of date
 toml_edit^0.21.00.25.11+spec-1.1.0out of date
 tracing^0.1.370.1.44up to date
 tracing-subscriber ⚠️^0.3.180.3.23maybe insecure
 unicase^2.7.02.9.0up to date
 unicode-width^0.1.110.2.2out of date
 unicode-xid^0.2.40.2.6up to date
 url^2.5.02.5.8up to date
 walkdir^2.4.02.5.0up to date
 windows-sys^0.520.61.2out of date

Dev dependencies

(2 total, 1 outdated)

CrateRequiredLatestStatus
 same-file^1.0.61.0.6up to date
 snapbox^0.4.141.2.1out of date

Security Vulnerabilities

libgit2-sys: Memory corruption, denial of service, and arbitrary code execution in libgit2

RUSTSEC-2024-0013

The libgit2 project fixed three security issues in the 1.7.2 release. These issues are:

  • The git_revparse_single function can potentially enter an infinite loop on a well-crafted input, potentially causing a Denial of Service. This function is exposed in the git2 crate via the Repository::revparse_single method.
  • The git_index_add function may cause heap corruption and possibly lead to arbitrary code execution. This function is exposed in the git2 crate via the Index::add method.
  • The smart transport negotiation may experience an out-of-bounds read when a remote server did not advertise capabilities.

The libgit2-sys crate bundles libgit2, or optionally links to a system libgit2 library. In either case, versions of the libgit2 library less than 1.7.2 are vulnerable. The 0.16.2 release of libgit2-sys bundles the fixed version of 1.7.2, and requires a system libgit2 version of at least 1.7.2.

It is recommended that all users upgrade.

gix-features: SHA-1 collision attacks are not detected

RUSTSEC-2025-0021

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 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:

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 or SHA-1 is a Shambles 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.

openssl: Use-After-Free in `Md::fetch` and `Cipher::fetch`

RUSTSEC-2025-0022

When a Some(...) value was passed to the properties argument of either of these functions, a use-after-free would result.

In practice this would nearly always result in OpenSSL treating the properties as an empty string (due to CString::drop's behavior).

The maintainers thank quitbug for reporting this vulnerability to us.

tracing-subscriber: Logging user input may result in poisoning logs with ANSI escape sequences

RUSTSEC-2025-0055

Previous versions of tracing-subscriber were vulnerable to ANSI escape sequence injection attacks. Untrusted user input containing ANSI escape sequences could be injected into terminal output when logged, potentially allowing attackers to:

  • Manipulate terminal title bars
  • Clear screens or modify terminal display
  • Potentially mislead users through terminal manipulation

In isolation, impact is minimal, however security issues have been found in terminal emulators that enabled an attacker to use ANSI escape sequences via logs to exploit vulnerabilities in the terminal emulator.

This was patched in PR #3368 to escape ANSI control characters from user input.

time: Denial of Service via Stack Exhaustion

RUSTSEC-2026-0009

Impact

When user-provided input is provided to any type that parses with the RFC 2822 format, a denial of service attack via stack exhaustion is possible. The attack relies on formally deprecated and rarely-used features that are part of the RFC 2822 format used in a malicious manner. Ordinary, non-malicious input will never encounter this scenario.

Patches

A limit to the depth of recursion was added in v0.3.47. From this version, an error will be returned rather than exhausting the stack.

Workarounds

Limiting the length of user input is the simplest way to avoid stack exhaustion, as the amount of the stack consumed would be at most a factor of the length of the input.

tar: `unpack_in` can chmod arbitrary directories by following symlinks

RUSTSEC-2026-0067

In versions 0.4.44 and below of tar-rs, when unpacking a tar archive, the tar crate's unpack_dir function uses fs::metadata() to check whether a path that already exists is a directory. Because fs::metadata() follows symbolic links, a crafted tarball containing a symlink entry followed by a directory entry with the same name causes the crate to treat the symlink target as a valid existing directory — and subsequently apply chmod to it. This allows an attacker to modify the permissions of arbitrary directories outside the extraction root.

This issue has been fixed in version 0.4.45.

tar: tar-rs incorrectly ignores PAX size headers if header size is nonzero

RUSTSEC-2026-0068

Versions 0.4.44 and below of tar-rs have conditional logic that skips the PAX size header in cases where the base header size is nonzero.

As part of CVE-2025-62518, the astral-tokio-tar project was changed to correctly honor PAX size headers in the case where it was different from the base header. This is almost the inverse of the astral-tokio-tar issue.

Any discrepancy in how tar parsers honor file size can be used to create archives that appear differently when unpacked by different archivers. In this case, the tar-rs (Rust tar) crate is an outlier in checking for the header size — other tar parsers (including e.g. Go archive/tar) unconditionally use the PAX size override. This can affect anything that uses the tar crate to parse archives and expects to have a consistent view with other parsers.

This issue has been fixed in version 0.4.45.