RUSTSEC-2026-0008
LOWgit2 has potential undefined behavior when dereferencing Buf struct
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.
- Published
- 2 Feb 2026
- Last modified
- 10 Sep 2026
- Weakness
- CWE-476
- Also known as
- GHSA-j39j-6gw9-jw6h
- Sources
- OSV GHSA-j39j-6gw9-jw6hJSONOSVJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | crates.io | git2 | < 0.20.4 | 0.20.4 |
| OSV | crates.io | git2 | >= 0.0.0-0, < 0.20.4 | 0.20.4 |
References
- https://github.com/rust-lang/git2-rs/issues/1211 · WEB
- https://github.com/rust-lang/git2-rs/pull/1213 · WEB
- https://github.com/rust-lang/git2-rs/commit/9e160f15bd056f82143109bb330573381e5de719 · WEB
- https://github.com/rust-lang/git2-rs · PACKAGE
- https://rustsec.org/advisories/RUSTSEC-2026-0008.html · WEB, ADVISORY
- https://crates.io/crates/git2 · PACKAGE
History
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 2 Feb 2026)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 4 Feb 2026)