Update Rust crate git2 to 0.21 [SECURITY] #3

Open
renovate wants to merge 1 commit from renovate/crate-git2-vulnerability into main
Collaborator

This PR contains the following updates:

Package Type Update Change
git2 dependencies minor 0.20 → 0.21

git2 has potential undefined behavior when dereferencing Buf struct

GHSA-j39j-6gw9-jw6h / RUSTSEC-2026-0008

More information

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

  • CVSS Score: 2.7 / 10 (Low)
  • Vector String: 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

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


Potential undefined behavior when dereferencing Buf struct

GHSA-j39j-6gw9-jw6h / RUSTSEC-2026-0008

More information

Details

if we dereference the Buf struct right after calling new() or default() on Buf struct, it passes Null Pointer to the unsafe function slice::from_raw_parts. Based on the safety section documentation of function,
data must be non-null and aligned even for zero-length slices or slices of ZSTs. Thus, passing Null Pointer will lead to undefined behavior.

Severity

Unknown

References

This data is provided by OSV and the Rust Advisory Database (CC0 1.0).


Potential undefined behavior when calling Remote::list()

RUSTSEC-2026-0183

More information

Details

When calling Remote::list() for a remote of a git repository, when that remote does not advertise any references, git2 passes a null pointer to the unsafe function slice::from_raw_parts(). Based on the safety section documentation of function, data must be non-null even for slices of length zero. Thus, the use of a null pointer leads to undefined behavior.

Severity

Unknown

References

This data is provided by OSV and the Rust Advisory Database (CC0 1.0).


Potential undefined behavior with Signature from a buffer-created BlameHunk

RUSTSEC-2026-0184

More information

Details

When a Blame is created via Blame::blame_buffer(), and a BlameHunk is retrieved, the pointers to the original author, original committer, final author, and final committer may be null if unavailable. The corresponding BlameHunk methods then create Signatures based on null pointers; attempting to access the data of the Signatures leads to dereferencing null pointers.

Severity

Unknown

References

This data is provided by OSV and the Rust Advisory Database (CC0 1.0).

❗ Important

Release Notes retrieval for this PR were skipped because no github.com credentials were available.
If you are self-hosted, please see this instruction.


Configuration

📅 Schedule: (in timezone UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [git2](https://github.com/rust-lang/git2-rs) | dependencies | minor | `0.20` → `0.21` | --- ### git2 has potential undefined behavior when dereferencing Buf struct [GHSA-j39j-6gw9-jw6h](https://github.com/advisories/GHSA-j39j-6gw9-jw6h) / [RUSTSEC-2026-0008](https://rustsec.org/advisories/RUSTSEC-2026-0008.html) <details> <summary>More information</summary> #### 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 - CVSS Score: 2.7 / 10 (Low) - Vector String: `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` #### References - [https://github.com/rust-lang/git2-rs/issues/1211](https://github.com/rust-lang/git2-rs/issues/1211) - [https://github.com/rust-lang/git2-rs/pull/1213](https://github.com/rust-lang/git2-rs/pull/1213) - [https://github.com/rust-lang/git2-rs/commit/9e160f15bd056f82143109bb330573381e5de719](https://github.com/rust-lang/git2-rs/commit/9e160f15bd056f82143109bb330573381e5de719) - [https://github.com/rust-lang/git2-rs](https://github.com/rust-lang/git2-rs) - [https://rustsec.org/advisories/RUSTSEC-2026-0008.html](https://rustsec.org/advisories/RUSTSEC-2026-0008.html) This data is provided by [OSV](https://osv.dev/vulnerability/GHSA-j39j-6gw9-jw6h) and the [GitHub Advisory Database](https://github.com/github/advisory-database) ([CC-BY 4.0](https://github.com/github/advisory-database/blob/main/LICENSE.md)). </details> --- ### Potential undefined behavior when dereferencing Buf struct [GHSA-j39j-6gw9-jw6h](https://github.com/advisories/GHSA-j39j-6gw9-jw6h) / [RUSTSEC-2026-0008](https://rustsec.org/advisories/RUSTSEC-2026-0008.html) <details> <summary>More information</summary> #### Details if we dereference the Buf struct right after calling new() or default() on Buf struct, it passes Null Pointer to the unsafe function slice::from_raw_parts. Based on the safety section documentation of function, data must be non-null and aligned even for zero-length slices or slices of ZSTs. Thus, passing Null Pointer will lead to undefined behavior. #### Severity Unknown #### References - [https://crates.io/crates/git2](https://crates.io/crates/git2) - [https://rustsec.org/advisories/RUSTSEC-2026-0008.html](https://rustsec.org/advisories/RUSTSEC-2026-0008.html) - [https://github.com/rust-lang/git2-rs/pull/1213](https://github.com/rust-lang/git2-rs/pull/1213) This data is provided by [OSV](https://osv.dev/vulnerability/RUSTSEC-2026-0008) and the [Rust Advisory Database](https://github.com/RustSec/advisory-db) ([CC0 1.0](https://github.com/rustsec/advisory-db/blob/main/LICENSE.txt)). </details> --- ### Potential undefined behavior when calling Remote::list() [RUSTSEC-2026-0183](https://rustsec.org/advisories/RUSTSEC-2026-0183.html) <details> <summary>More information</summary> #### Details When calling `Remote::list()` for a remote of a git repository, when that remote does not advertise any references, git2 passes a null pointer to the unsafe function `slice::from_raw_parts()`. Based on the safety section documentation of function, data must be non-null even for slices of length zero. Thus, the use of a null pointer leads to undefined behavior. #### Severity Unknown #### References - [https://crates.io/crates/git2](https://crates.io/crates/git2) - [https://rustsec.org/advisories/RUSTSEC-2026-0183.html](https://rustsec.org/advisories/RUSTSEC-2026-0183.html) - [https://github.com/rust-lang/git2-rs/pull/1250](https://github.com/rust-lang/git2-rs/pull/1250) This data is provided by [OSV](https://osv.dev/vulnerability/RUSTSEC-2026-0183) and the [Rust Advisory Database](https://github.com/RustSec/advisory-db) ([CC0 1.0](https://github.com/rustsec/advisory-db/blob/main/LICENSE.txt)). </details> --- ### Potential undefined behavior with Signature from a buffer-created BlameHunk [RUSTSEC-2026-0184](https://rustsec.org/advisories/RUSTSEC-2026-0184.html) <details> <summary>More information</summary> #### Details When a `Blame` is created via `Blame::blame_buffer()`, and a `BlameHunk` is retrieved, the pointers to the original author, original committer, final author, and final committer may be null if unavailable. The corresponding `BlameHunk` methods then create `Signature`s based on null pointers; attempting to access the data of the `Signature`s leads to dereferencing null pointers. #### Severity Unknown #### References - [https://crates.io/crates/git2](https://crates.io/crates/git2) - [https://rustsec.org/advisories/RUSTSEC-2026-0184.html](https://rustsec.org/advisories/RUSTSEC-2026-0184.html) - [https://github.com/rust-lang/git2-rs/pull/1254](https://github.com/rust-lang/git2-rs/pull/1254) This data is provided by [OSV](https://osv.dev/vulnerability/RUSTSEC-2026-0184) and the [Rust Advisory Database](https://github.com/RustSec/advisory-db) ([CC0 1.0](https://github.com/rustsec/advisory-db/blob/main/LICENSE.txt)). </details> > ❗ **Important** > > Release Notes retrieval for this PR were skipped because no github.com credentials were available. > If you are self-hosted, please see [this instruction](https://github.com/renovatebot/renovate/blob/master/docs/usage/examples/self-hosting.md#githubcom-token-for-release-notes). --- ### Configuration 📅 **Schedule**: (in timezone UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMzIuMiIsInVwZGF0ZWRJblZlciI6IjQ0LjEzMi4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->
Update Rust crate git2 to 0.21 [SECURITY]
Some checks failed
Dependency security / osv (pull_request) Failing after 4s
Dependency security / osv (push) Failing after 4s
b0007dc6bd
Some checks failed
Dependency security / osv (pull_request) Failing after 4s
Dependency security / osv (push) Failing after 4s
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin renovate/crate-git2-vulnerability:renovate/crate-git2-vulnerability
git switch renovate/crate-git2-vulnerability

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff renovate/crate-git2-vulnerability
git switch renovate/crate-git2-vulnerability
git rebase main
git switch main
git merge --ff-only renovate/crate-git2-vulnerability
git switch renovate/crate-git2-vulnerability
git rebase main
git switch main
git merge --no-ff renovate/crate-git2-vulnerability
git switch main
git merge --squash renovate/crate-git2-vulnerability
git switch main
git merge --ff-only renovate/crate-git2-vulnerability
git switch main
git merge renovate/crate-git2-vulnerability
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
thomas/luma!3
No description provided.