CVE-2023-22742
Description
libgit2 is a cross-platform, linkable library implementation of Git. When using an SSH remote with the optional libssh2 backend, libgit2 does not perform certificate checking by default. Prior versions of libgit2 require the caller to set the `certificate_check` field of libgit2's `git_remote_callbacks` structure - if a certificate check callback is not set, libgit2 does not perform any certificate checking. This means that by default - without configuring a certificate check callback, clients will not perform validation on the server SSH keys and may be subject to a man-in-the-middle attack. Users are encouraged to upgrade to v1.4.5 or v1.5.1. Users unable to upgrade should ensure that all relevant certificates are manually checked.
Predictions
Heuristic predictions, AS-IS, for prioritization only.
Mitigations
No mitigations published for this CVE yet.
The vendor-content worker queues fetches as references arrive (check back in a few minutes). Or โ if you've already worked around this in production โ publish your fix to the community-verified tier.
โ Propose a mitigation on Community โ Mitigations published via the community go through AI scoring + 2 human reviewers + 7-day silent objection window before landing here withsource_tier=community-verified.
OS impact
| OS | Version | Status | Fixed in |
|---|---|---|---|
| sles | affected | | |
| debian | bookworm | fixed | 1.5.1+ds-1 |
| debian | bullseye | fixed | 1.1.0+dfsg.1-4+deb11u1 |
| debian | forky | fixed | 1.5.1+ds-1 |
| debian | sid | fixed | 1.5.1+ds-1 |
| debian | trixie | fixed | 1.5.1+ds-1 |
Package impact
| Ecosystem | Package | Vulnerable | Fixed |
|---|---|---|---|
| crates.io | libgit2-sys | | |
| crates.io | libgit2-sys | >=0.14.0,<0.14.2 | 0.14.2 |
| crates.io | libgit2-sys | <0.13.5 | 0.13.5 |
| crates.io | git2 | <0.16.1 | 0.16.1 |
References
- https://github.com/rust-lang/git2-rs/security/advisories/GHSA-m4ch-rfv5-x5g3
- https://www.suse.com/security/cve/CVE-2023-22742.html
- https://security-tracker.debian.org/tracker/CVE-2023-22742
- https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq
- https://nvd.nist.gov/vuln/detail/CVE-2023-22742
- https://github.com/rust-lang/git2-rs/commit/87934f87d36753ed702792ec063be7246444a8e1
- https://github.com/rust-lang/git2-rs
- https://rustsec.org/advisories/RUSTSEC-2023-0003.html
- https://crates.io/crates/libgit2-sys
Community-verified mitigations for this CVE will appear above when contributors publish them.
Verify integrity in audit chain (admin only). AS-IS.