Advisory

GHSA-j39j-6gw9-jw6h

Also known as: RUSTSEC-2026-0008

Summary

git2 has potential undefined behavior when dereferencing Buf struct

Details

If the Buf struct is dereferenced immediately after calling new() or default() on the Buf struct, a null pointer is passed to the unsafe function slice::from_raw_parts. According to the safety section documentation of the function, data must be non-null and aligned even for zero-length slices or slices of ZSTs. Thus, passing a null pointer will lead to undefined behavior.

Severity

Low Basis: The source's own band: LOW

Dates

Published
2026-02-04 20:36 UTC
Modified
2026-09-10 03:50 UTC

Affected packages and fixes

git2

crates.io · All systems

Affected

  • introduced 0, fixed 0.20.4 (semver)

Fixed versions

0.20.4

Fix

  • Fixed version 0.20.4
    cargo update -p git2 --precise 0.20.4

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences