Skip to content
Fencer Intel
low —

GHSA-j39j-6gw9-jw6h json

git2 has potential undefined behavior when dereferencing Buf struct

published 9mo ago modified 2mo ago also RUSTSEC-2026-0008

cvss
—
not scored
cisa kev
Not listed
not in CISA's catalog
epss
—
no score, EPSS covers CVEs only
public exploits
0
none known

Summary

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.

Patch / fix

  • crates.io git2 0.20.4

Is GHSA-j39j-6gw9-jw6h in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.

Check with Fencer

Affected packages

ecosystem package affected fixed in
crates.io git2
<0.20.4
>=0.0.0-0, <0.20.4
0.20.4

Classification

Weakness

References

Sources

Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.