{"id":"CVE-2023-22742","published":"2023-01-20T22:49:06Z","modified":"2025-03-10T21:21:08Z","title":"libgit2 fails to verify SSH keys by default","vendor":"libgit2","product":"libgit2","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.3,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0047,"percentile":0.32778,"provenance":"source"},"cwes":[{"id":"CWE-347","name":"Improper Verification of Cryptographic Signature"}],"references":[{"url":"https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/libgit2/libgit2/commit/42e5db98b963ae503229c63e44e06e439df50e56","tags":["x_refsource_MISC"]},{"url":"https://github.com/libgit2/libgit2/commit/cd6f679af401eda1f172402006ef8265f8bd58ea","tags":["x_refsource_MISC"]},{"url":"https://github.com/libgit2/libgit2/releases/tag/v1.4.5","tags":["x_refsource_MISC"]},{"url":"https://github.com/libgit2/libgit2/releases/tag/v1.5.1","tags":["x_refsource_MISC"]},{"url":"https://www.libssh2.org","tags":["x_refsource_MISC"]},{"url":"http://www.openwall.com/lists/oss-security/2023/11/06/5","tags":[]}],"priority":{"score":10.3,"factors":[{"name":"EPSS percentile","points":6.56},{"name":"CVSS severity","points":3.71}]},"vendorSlug":"libgit2","affectedVersions":[{"vendor":"libgit2","product":"libgit2","versions":["< 1.4.5","= 1.5.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2025-03-10T20:59:36.699887Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"crates.io","package":"libgit2-sys","vulnerableRanges":[">=0.0.0-0, <0.13.5",">=0.14.0, <0.14.2"],"patched":["0.13.5","0.14.2"],"from":["RUSTSEC-2023-0003"],"provenance":"source"}],"summary":{"text":"libgit2's SSH remote support, when built with the optional libssh2 backend, does not verify server SSH keys unless the caller sets a certificate check callback in the git_remote_callbacks structure. An attacker positioned on the network path between the client and an SSH remote can perform a man-in-the-middle attack, which requires the victim to take an action such as initiating a connection, and is feasible only where the application has not configured certificate checking.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:45:30Z"},"euvd":{"id":"EUVD-2023-26860","exploited":false,"provenance":"source"}}