CVE-2023-22742
MEDIUM 5.9CVSS 3.1git2-rs fails to verify SSH keys by default
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.
- Published
- 20 Jan 2023
- Last modified
- 14 Oct 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-347
- Also known as
- GHSA-8643-3wh5-rmjqGHSA-m4ch-rfv5-x5g3RUSTSEC-2023-0003
- Sources
- NVDJSONOSV GHSA-m4ch-rfv5-x5g3JSONOSV RUSTSEC-2023-0003JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 3.1 | MEDIUM 6.8 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 5.9 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | MEDIUM 5.3 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | libgit2 | libgit2cpe:2.3:a:libgit2:libgit2:*:*:*:*:*:*:*:* |
< 1.4.5 | 1.4.5 |
| NVD | libgit2 | libgit2cpe:2.3:a:libgit2:libgit2:1.5.0:*:*:*:*:*:*:* |
= 1.5.0 | |
| OSV | crates.io | libgit2-sys | >= 0.14.0, < 0.14.2 | 0.14.2 |
| OSV | crates.io | libgit2-sys | < 0.13.5 | 0.13.5 |
| OSV | crates.io | git2 | < 0.16.1 | 0.16.1 |
| OSV | crates.io | libgit2-sys | >= 0.0.0-0, < 0.13.5; >= 0.14.0, < 0.14.2 | 0.13.5, 0.14.2 |
References
- http://www.openwall.com/lists/oss-security/2023/11/06/5
- https://github.com/libgit2/libgit2/commit/42e5db98b963ae503229c63e44e06e439df50e56 · Patch, Third Party Advisory
- https://github.com/libgit2/libgit2/commit/cd6f679af401eda1f172402006ef8265f8bd58ea · Patch, Third Party Advisory
- https://github.com/libgit2/libgit2/releases/tag/v1.4.5 · Release Notes, Third Party Advisory
- https://github.com/libgit2/libgit2/releases/tag/v1.5.1 · Release Notes, Third Party Advisory
- https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq · Third Party Advisory, WEB
- https://www.libssh2.org · Third Party Advisory
- https://github.com/rust-lang/git2-rs/security/advisories/GHSA-m4ch-rfv5-x5g3 · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2023-22742 · ADVISORY
- https://github.com/rust-lang/git2-rs/commit/87934f87d36753ed702792ec063be7246444a8e1 · WEB
- https://github.com/rust-lang/git2-rs · PACKAGE
- https://rustsec.org/advisories/RUSTSEC-2023-0003.html · WEB, ADVISORY
- https://crates.io/crates/libgit2-sys · PACKAGE
History
- 25 Nov 2026 20:35 UTC · NVD: first stored (published 20 Jan 2023)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 20 Jan 2023)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 20 Jan 2023)