Skip to content

fix(deps): update git2 to 0.20.4 (libgit2 1.9.2) for security fixes#1733

Open
peaktwilight wants to merge 2 commits intoeza-community:mainfrom
peaktwilight:fix/update-libgit2-security
Open

fix(deps): update git2 to 0.20.4 (libgit2 1.9.2) for security fixes#1733
peaktwilight wants to merge 2 commits intoeza-community:mainfrom
peaktwilight:fix/update-libgit2-security

Conversation

@peaktwilight
Copy link

@peaktwilight peaktwilight commented Mar 2, 2026

Description

Updates git2 from 0.20.2 to 0.20.4, which pulls in libgit2-sys 0.18.3+1.9.2 (libgit2 1.9.2). This addresses two security vulnerabilities fixed in libgit2 1.9.2:

  1. SSH arbitrary command execution — Remote repository names were improperly sent to the shell without quoting when using external SSH transport, potentially allowing arbitrary command execution.

  2. SSH public key buffer overflow — Public keys that are not NUL-terminated were improperly zeroed using memset with the wrong length, resulting in a buffer overflow or incomplete key zeroing.

Changes:

  • Cargo.toml: Bump git2 version requirement from "0.20" to "0.20.4"
  • Cargo.lock: git2 0.20.2 → 0.20.4, libgit2-sys 0.18.2+1.9.1 → 0.18.3+1.9.2

References:

Fixes: #1734

How Has This Been Tested?

This is a dependency-only update with no API changes between git2 0.20.2 and 0.20.4. Verified locally that cargo update resolves correctly and the lockfile only changes the git2 and libgit2-sys entries.

  • cargo check passes
  • Lockfile diff is minimal (only git2 + libgit2-sys version and checksum)
  • Lockfile version stays at v3 (MSRV compatible)

Note: The security_audit CI job has a pre-existing failure on main due to RUSTSEC-2026-0009 (time v0.3.44), which is unrelated to this change. See run #22494088282.

Update git2 from 0.20.2 to 0.20.4, which pulls in libgit2-sys
0.18.3+1.9.2 (libgit2 1.9.2). This addresses two security
vulnerabilities fixed in libgit2 1.9.2:

1. SSH arbitrary command execution: remote repository names were
   improperly sent to the shell without quoting when using external
   SSH transport, allowing arbitrary command execution.

2. SSH public key buffer overflow: public keys that are not
   NUL-terminated were improperly zeroed using memset with the wrong
   length, resulting in a buffer overflow or incomplete key zeroing.

Ref: https://github.com/libgit2/libgit2/releases/tag/v1.9.2
Ref: https://libgit2.org/security/
@peaktwilight peaktwilight force-pushed the fix/update-libgit2-security branch from 41250ab to 38f2b0a Compare March 2, 2026 08:15
@peaktwilight
Copy link
Author

Note on CI: The security_audit job may still fail due to a pre-existing RUSTSEC-2026-0009 advisory on time v0.3.44 (transitive dependency via plist). This is already failing on main (run #22494088282) and is unrelated to this PR.

The fix for time requires v0.3.47+ which needs Rust 1.88.0, exceeding the current MSRV (1.82). That's a separate issue to address.

This PR only changes:

  • Cargo.toml: git2 version "0.20""0.20.4"
  • Cargo.lock: git2 0.20.2 → 0.20.4, libgit2-sys 0.18.2+1.9.1 → 0.18.3+1.9.2

@peaktwilight peaktwilight marked this pull request as draft March 2, 2026 08:16
@peaktwilight peaktwilight marked this pull request as ready for review March 2, 2026 08:20
Copy link
Member

@cafkafk cafkafk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the CI check mentions, you have to rebase this interactively to not include unnescessarry merge commits in the history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: update libgit2 to 1.9.2 for security fixes

3 participants