{"id":"CVE-2023-22742","aliases":["ALPINE-CVE-2023-22742","AZL-13175","DEBIAN-CVE-2023-22742","DLA-3340-1","EUVD-2023-26860","GHSA-8643-3wh5-rmjq","GHSA-m4ch-rfv5-x5g3","JLSEC-2025-184","MGASA-2024-0059","OESA-2023-1957","RUSTSEC-2023-0003","SUSE-SU-2023:1570-1","SUSE-SU-2023:1788-1","SUSE-SU-2023:1909-1","UBUNTU-CVE-2023-22742","USN-6678-1","openSUSE-SU-2024:12632-1"],"status":"published","title":"libgit2 fails to verify SSH keys by default","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.","severity":{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.00607,"percentile":0.49491,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-347"],"published":"2023-01-20T12:00:00Z","modified":"2026-11-03T06:31:59Z","fixes":[{"ecosystem":"crates.io","package":"libgit2-sys","fixed_in":["0.14.2","0.13.5"],"sources":["ghsa","osv"]},{"ecosystem":"crates.io","package":"git2","fixed_in":["0.16.1"],"sources":["ghsa","osv"]},{"ecosystem":"Alpine:v3.17","package":"libgit2","fixed_in":["1.5.1-r0"],"sources":["osv"]},{"ecosystem":"Azure Linux:2","package":"rust","fixed_in":["1.68.0-1"],"sources":["osv"]},{"ecosystem":"Debian:12","package":"libgit2","fixed_in":["1.5.1+ds-1"],"sources":["osv"]},{"ecosystem":"Debian:13","package":"libgit2","fixed_in":["1.5.1+ds-1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"libgit2","fixed_in":["1.5.1+ds-1"],"sources":["osv"]},{"ecosystem":"Julia","package":"LibGit2_jll","fixed_in":["1.6.1+0"],"sources":["osv"]},{"ecosystem":"openEuler:20.03-LTS-SP1","package":"libgit2","fixed_in":["0.27.8-7.oe1"],"sources":["osv"]},{"ecosystem":"openEuler:20.03-LTS-SP3","package":"libgit2","fixed_in":["0.27.8-7.oe1"],"sources":["osv"]},{"ecosystem":"openEuler:20.03-LTS-SP4","package":"libgit2","fixed_in":["0.27.8-7.oe2003sp4"],"sources":["osv"]},{"ecosystem":"openEuler:22.03-LTS","package":"libgit2","fixed_in":["1.3.2-2.oe2203sp2"],"sources":["osv"]},{"ecosystem":"openEuler:22.03-LTS-SP1","package":"libgit2","fixed_in":["1.3.2-2.oe2203sp1"],"sources":["osv"]},{"ecosystem":"openEuler:22.03-LTS-SP2","package":"libgit2","fixed_in":["1.3.2-2.oe2203sp2"],"sources":["osv"]},{"ecosystem":"openSUSE:Leap 15.4","package":"libgit2","fixed_in":["0.26.8-150000.3.18.1","1.3.0-150400.3.6.1","0.28.4-150200.3.6.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP4","package":"libgit2","fixed_in":["1.3.0-150400.3.6.1"],"sources":["osv"]},{"ecosystem":"SUSE:Manager Server Module 4.2","package":"libgit2","fixed_in":["0.28.4-150200.3.6.1"],"sources":["osv"]},{"ecosystem":"SUSE:Manager Server Module 4.3","package":"libgit2","fixed_in":["0.28.4-150200.3.6.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Real Time 15 SP3","package":"libgit2","fixed_in":["0.28.4-150200.3.6.1"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:16.04:LTS","package":"libgit2","fixed_in":["0.24.1-2ubuntu0.2+esm2"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:18.04:LTS","package":"libgit2","fixed_in":["0.26.0+dfsg.1-1.1ubuntu0.2+esm1"],"sources":["osv"]},{"ecosystem":"Ubuntu:20.04:LTS","package":"libgit2","fixed_in":["0.28.4+dfsg.1-2ubuntu0.1"],"sources":["osv"]},{"ecosystem":"Ubuntu:22.04:LTS","package":"libgit2","fixed_in":["1.1.0+dfsg.1-4.1ubuntu0.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Tumbleweed","package":"libgit2","fixed_in":["1.5.1-1.1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"libgit2-sys","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.14.0"},{"fixed":"0.14.2"}]}]},{"source":"ghsa","ecosystem":"crates.io","package":"libgit2-sys","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.13.5"}]}]},{"source":"ghsa","ecosystem":"crates.io","package":"git2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.16.1"}]}]},{"source":"osv","ecosystem":"Alpine:v3.17","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.5.1-r0"}]}]},{"source":"osv","ecosystem":"Azure Linux:2","package":"rust","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.68.0-1"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.5.1+ds-1"}]}]},{"source":"osv","ecosystem":"Debian:13","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.5.1+ds-1"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.5.1+ds-1"}]}]},{"source":"osv","ecosystem":"Debian:10","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.27.7+dfsg.1-0.2+deb10u1"}]}],"versions":["0.27.7+dfsg.1-0.2"],"bundled":3},{"source":"osv","ecosystem":"crates.io","package":"libgit2-sys","ranges":[{"type":"SEMVER","events":[{"introduced":"0.14.0"},{"fixed":"0.14.2"}]}]},{"source":"osv","ecosystem":"crates.io","package":"libgit2-sys","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.13.5"}]}]},{"source":"osv","ecosystem":"crates.io","package":"git2","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.16.1"}]}]},{"source":"osv","ecosystem":"Julia","package":"LibGit2_jll","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.6.1+0"}]}]},{"source":"osv","ecosystem":"Mageia:9","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.3.2-1.1.mga9"}]}],"bundled":2},{"source":"osv","ecosystem":"openEuler:20.03-LTS-SP1","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.27.8-7.oe1"}]}]},{"source":"osv","ecosystem":"openEuler:20.03-LTS-SP3","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.27.8-7.oe1"}]}]},{"source":"osv","ecosystem":"openEuler:20.03-LTS-SP4","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.27.8-7.oe2003sp4"}]}]},{"source":"osv","ecosystem":"openEuler:22.03-LTS","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.3.2-2.oe2203sp2"}]}]},{"source":"osv","ecosystem":"openEuler:22.03-LTS-SP1","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.3.2-2.oe2203sp1"}]}]},{"source":"osv","ecosystem":"openEuler:22.03-LTS-SP2","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.3.2-2.oe2203sp2"}]}]},{"source":"osv","ecosystem":"crates.io","package":"libgit2-sys","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.13.5"},{"introduced":"0.14.0"},{"fixed":"0.14.2"}]}]},{"source":"osv","ecosystem":"openSUSE:Leap 15.4","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.26.8-150000.3.18.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP4","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.3.0-150400.3.6.1"}]}]},{"source":"osv","ecosystem":"openSUSE:Leap 15.4","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.3.0-150400.3.6.1"}]}]},{"source":"osv","ecosystem":"SUSE:Manager Server Module 4.2","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.28.4-150200.3.6.1"}]}]},{"source":"osv","ecosystem":"SUSE:Manager Server Module 4.3","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.28.4-150200.3.6.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Real Time 15 SP3","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.28.4-150200.3.6.1"}]}]},{"source":"osv","ecosystem":"openSUSE:Leap 15.4","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.28.4-150200.3.6.1"}]}]},{"source":"osv","ecosystem":"Ubuntu:Pro:16.04:LTS","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.24.1-2ubuntu0.2+esm2"}]}],"versions":["0.22.2-2","0.23.1-1","0.24.1-2","0.24.1-2ubuntu0.2","0.24.1-2ubuntu0.2+esm1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.26.0+dfsg.1-1.1ubuntu0.2+esm1"}]}],"versions":["0.25.1+really0.24.6-1","0.26.0+dfsg.1-1.1","0.26.0+dfsg.1-1.1build1","0.26.0+dfsg.1-1.1ubuntu0.2"]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.28.4+dfsg.1-2ubuntu0.1"}]}],"versions":["0.27.7+dfsg.1-0.2build1","0.28.3+dfsg.1-1","0.28.3+dfsg.1-1ubuntu1","0.28.4+dfsg.1-2"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.1.0+dfsg.1-4.1ubuntu0.1"}]}],"versions":["1.1.0+dfsg.1-4","1.1.0+dfsg.1-4.1","1.1.0+dfsg.1-4.1build1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:16.04:LTS","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.24.1-2ubuntu0.2+esm2"}]}],"versions":["0.22.2-2","0.23.1-1","0.24.1-2","0.24.1-2ubuntu0.2","0.24.1-2ubuntu0.2+esm1"],"bundled":4},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.26.0+dfsg.1-1.1ubuntu0.2+esm1"}]}],"versions":["0.25.1+really0.24.6-1","0.26.0+dfsg.1-1.1","0.26.0+dfsg.1-1.1build1","0.26.0+dfsg.1-1.1ubuntu0.2"],"bundled":4},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.28.4+dfsg.1-2ubuntu0.1"}]}],"versions":["0.27.7+dfsg.1-0.2build1","0.28.3+dfsg.1-1","0.28.3+dfsg.1-1ubuntu1","0.28.4+dfsg.1-2"],"bundled":4},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.1.0+dfsg.1-4.1ubuntu0.1"}]}],"versions":["1.1.0+dfsg.1-4","1.1.0+dfsg.1-4.1","1.1.0+dfsg.1-4.1build1"],"bundled":4},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"libgit2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.5.1-1.1"}]}]}],"products":[{"vendor":"libgit2","product":"libgit2"}],"references":[{"url":"https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory","web","report"]},{"url":"https://github.com/libgit2/libgit2/commit/42e5db98b963ae503229c63e44e06e439df50e56","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/libgit2/libgit2/commit/cd6f679af401eda1f172402006ef8265f8bd58ea","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/libgit2/libgit2/releases/tag/v1.4.5","tags":["x_refsource_MISC","x_transferred","Release Notes","Third Party Advisory","web","report"]},{"url":"https://github.com/libgit2/libgit2/releases/tag/v1.5.1","tags":["x_refsource_MISC","x_transferred","Release Notes","Third Party Advisory","web","report"]},{"url":"https://www.libssh2.org","tags":["x_refsource_MISC","x_transferred","Third Party Advisory","web","report"]},{"url":"http://www.openwall.com/lists/oss-security/2023/11/06/5","tags":["x_transferred","web"]},{"url":"https://github.com/rust-lang/git2-rs/security/advisories/GHSA-m4ch-rfv5-x5g3","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-22742","tags":["web","advisory"]},{"url":"https://github.com/rust-lang/git2-rs/commit/87934f87d36753ed702792ec063be7246444a8e1","tags":["web"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2023-0003.html","tags":["web","advisory"]},{"url":"https://github.com/advisories/GHSA-m4ch-rfv5-x5g3"},{"url":"https://security.alpinelinux.org/vuln/CVE-2023-22742","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/22xxx/CVE-2023-22742.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2023-22742","tags":["advisory"]},{"url":"https://github.com/rust-lang/git2-rs","tags":["package"]},{"url":"https://advisories.mageia.org/MGASA-2024-0059.html","tags":["advisory"]},{"url":"https://bugs.mageia.org/show_bug.cgi?id=30633","tags":["report"]},{"url":"https://www.debian.org/lts/security/2023/dla-3340","tags":["web"]},{"url":"https://lists.suse.com/pipermail/sle-security-updates/2023-March/014158.html","tags":["web"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/02/msg00012.html","tags":["web"]},{"url":"https://www.openeuler.org/en/security/safety-bulletin/detail.html?id=openEuler-SA-2023-1957","tags":["advisory"]},{"url":"https://crates.io/crates/libgit2-sys","tags":["package"]},{"url":"https://www.suse.com/support/update/announcement/2023/suse-su-20231570-1/","tags":["advisory"]},{"url":"https://bugzilla.suse.com/1207364","tags":["report"]},{"url":"https://www.suse.com/security/cve/CVE-2023-22742","tags":["web"]},{"url":"https://www.suse.com/support/update/announcement/2023/suse-su-20231788-1/","tags":["advisory"]},{"url":"https://www.suse.com/support/update/announcement/2023/suse-su-20231909-1/","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2023-22742","tags":["report"]},{"url":"https://ubuntu.com/security/notices/USN-6678-1","tags":["advisory"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2023-22742","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2020-12278","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2020-12279","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2024-24575","tags":["report"]},{"url":"https://ubuntu.com/security/CVE-2024-24577","tags":["report"]},{"url":"","tags":["advisory"]}],"sources":{"cve":[{"id":"CVE-2023-22742","title":"libgit2 fails to verify SSH keys by default","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.","status":"published","published":"2023-01-20T22:49:06.378Z","modified":"2025-03-10T21:21:08.962Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-347"],"updated_at":"2026-11-02T14:35:15.779187Z"}],"euvd":[{"id":"EUVD-2023-26860","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.","status":"published","published":"2023-01-20T22:49:06Z","modified":"2025-03-10T21:21:08Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","level":"medium"}],"updated_at":"2026-11-02T20:53:08.584552Z"}],"ghsa":[{"id":"GHSA-m4ch-rfv5-x5g3","title":"git2-rs fails to verify SSH keys by default","description":"The git2 and libgit2-sys crates are Rust wrappers around the [libgit2](https://libgit2.org/) C library. It was discovered that libgit2 1.5.0 and below did not verify SSH host keys when establishing an SSH connection, exposing users of the library to Man-In-the-Middle attacks.\n\nThe libgit2 team assigned [CVE-2023-22742](https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq) to this vulnerability. The following versions of the libgit2-sys Rust crate have been released:\n\n* libgit2-sys 0.14.2, updating the underlying libgit2 C library to version 1.5.1.\n* libgit2-sys 0.13.5, updating the underlying libgit2 C library to version 1.4.5.\n\nA new git2 crate version has also been released, 0.16.1. This version only bumps its libgit2-sys dependency to ensure no vulnerable libgit2-sys versions are used, but contains no code changes: if you update the libgit2-sys version there is no need to also update the git2 crate version.\n\n[You can learn more about this vulnerability in libgit2's advisory](https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq)","status":"published","published":"2023-01-20T23:36:41Z","modified":"2023-01-23T18:57:27Z","cvss":[{"version":"3.1","score":6.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N","level":"medium"}],"updated_at":"2026-11-02T14:36:14.033357Z"}],"nvd":[{"id":"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.","status":"published","published":"2023-01-20T23:15:10.307Z","modified":"2026-06-17T05:36:04.797Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","level":"medium","assessor":"secondary"},{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-347"],"updated_at":"2026-11-02T14:07:46.064662Z"}],"osv":[{"id":"ALPINE-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.","status":"published","published":"2023-01-20T23:15:10.307Z","modified":"2026-11-03T06:31:59.730546208Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium"}],"updated_at":"2026-11-03T07:18:15.355745Z"},{"id":"AZL-13175","title":"CVE-2023-22742 affecting package rust for versions less than 1.68.0-1","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.","status":"published","published":"2023-01-20T23:15:10Z","modified":"2026-04-21T04:22:42.769883Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium"}],"updated_at":"2026-11-02T15:28:02.666535Z"},{"id":"CVE-2023-22742","title":"libgit2 fails to verify SSH keys by default","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.","status":"published","published":"2023-01-20T22:49:06.378Z","modified":"2026-10-28T02:30:23.149119473Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","level":"medium"}],"cwes":["CWE-347"],"updated_at":"2026-11-02T15:44:30.334753Z"},{"id":"DEBIAN-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.","status":"published","published":"2023-01-20T23:15:10.307Z","modified":"2026-10-26T18:00:30.667176938Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium"}],"updated_at":"2026-11-02T15:45:39.369204Z"},{"id":"GHSA-m4ch-rfv5-x5g3","title":"git2-rs fails to verify SSH keys by default","description":"The git2 and libgit2-sys crates are Rust wrappers around the [libgit2](https://libgit2.org/) C library. It was discovered that libgit2 1.5.0 and below did not verify SSH host keys when establishing an SSH connection, exposing users of the library to Man-In-the-Middle attacks.\n\nThe libgit2 team assigned [CVE-2023-22742](https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq) to this vulnerability. The following versions of the libgit2-sys Rust crate have been released:\n\n* libgit2-sys 0.14.2, updating the underlying libgit2 C library to version 1.5.1.\n* libgit2-sys 0.13.5, updating the underlying libgit2 C library to version 1.4.5.\n\nA new git2 crate version has also been released, 0.16.1. This version only bumps its libgit2-sys dependency to ensure no vulnerable libgit2-sys versions are used, but contains no code changes: if you update the libgit2-sys version there is no need to also update the git2 crate version.\n\n[You can learn more about this vulnerability in libgit2's advisory](https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq)","status":"published","published":"2023-01-20T23:36:41Z","modified":"2026-10-14T17:07:22Z","cvss":[{"version":"3.1","score":6.8,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N","level":"medium"}],"updated_at":"2026-11-02T15:46:51.463834Z"},{"id":"JLSEC-2025-184","title":"libgit2 is a cross-platform, linkable library implementation of Git","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.","status":"published","published":"2025-10-21T19:17:09.363Z","modified":"2026-07-18T00:00:54.825363481Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium"}],"updated_at":"2026-11-02T15:47:17.805107Z"},{"id":"OESA-2023-1957","title":"libgit2 security update","description":"libgit2 is a portable, pure C implementation of the Git core methods provided as a re-entrant linkable library with a solid API, allowing you to write native speed custom Git applications in any language which supports C bindings.\r\n\r\nSecurity Fix(es):\r\n\r\nlibgit2 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\u0026apos;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.(CVE-2023-22742)","status":"published","published":"2023-12-22T11:06:24Z","modified":"2026-08-18T01:18:07.128640492Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium"}],"updated_at":"2026-11-02T15:52:40.71472Z"},{"id":"UBUNTU-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.","status":"published","published":"2023-01-20T23:15:00Z","modified":"2026-08-12T19:45:20.166031575Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","level":"medium"},{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","level":"medium"}],"updated_at":"2026-11-02T16:54:20.198616Z"},{"id":"DLA-3340-1","title":"libgit2 - security update","status":"published","published":"2023-02-23T00:00:00Z","modified":"2026-03-09T01:21:33.663191Z","updated_at":"2026-11-02T15:46:11.734021Z"},{"id":"MGASA-2024-0059","title":"Updated libgit2 packages fix security vulnerabilities","description":"When using an SSH remote with the optional libssh2 backend, libgit2 does\nnot perform certificate checking by default. (CVE-2023-22742)\nUsing well-crafted inputs to `git_index_add` can cause heap corruption\nthat could be leveraged for arbitrary code execution. (CVE-2024-24577)\n","status":"published","published":"2024-03-14T17:25:59Z","modified":"2026-04-16T04:44:37.99077093Z","updated_at":"2026-11-02T15:49:42.684501Z"},{"id":"openSUSE-SU-2024:12632-1","title":"libgit2-1.5.1-1.1 on GA media","description":"These are all security issues fixed in the libgit2-1.5.1-1.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2024-06-15T00:00:00Z","modified":"2025-05-07T18:14:41.415071Z","updated_at":"2026-11-02T16:58:35.751245Z"},{"id":"RUSTSEC-2023-0003","title":"git2 does not verify SSH keys by default","description":"The git2 and libgit2-sys crates are Rust wrappers around the\n[libgit2]() C library. It was discovered that libgit2 1.5.0\nand below did not verify SSH host keys when establishing an SSH connection,\nexposing users of the library to Man-In-the-Middle attacks.\n\nThe libgit2 team assigned [CVE-2023-22742][libgit2-advisory] to this\nvulnerability. The following versions of the libgit2-sys Rust crate have been\nreleased:\n\n* libgit2-sys 0.14.2, updating the underlying libgit2 C library to version 1.5.1.\n* libgit2-sys 0.13.5, updating the underlying libgit2 C library to version 1.4.5.\n\nA new git2 crate version has also been released, 0.16.1. This version only\nbumps its libgit2-sys dependency to ensure no vulnerable libgit2-sys versions\nare used, but contains no code changes: if you update the libgit2-sys version\nthere is no need to also update the git2 crate version.\n\n[You can learn more about this vulnerability in libgit2's advisory][libgit2-advisory]\n\n[libgit2]: https://libgit2.org/\n[libgit2-advisory]: https://github.com/libgit2/libgit2/security/advisories/GHSA-8643-3wh5-rmjq","status":"published","published":"2023-01-20T12:00:00Z","modified":"2026-10-12T18:00:06.112206414Z","updated_at":"2026-11-02T15:53:39.971022Z"},{"id":"SUSE-SU-2023:1570-1","title":"Security update for libgit2","description":"This update for libgit2 fixes the following issues:\n\n- CVE-2023-22742: Fixed SSH keys verification failure (bsc#1207364).\n","status":"published","published":"2023-03-24T12:11:55Z","modified":"2026-02-04T03:24:37.760437Z","updated_at":"2026-11-02T15:53:52.350754Z"},{"id":"SUSE-SU-2023:1788-1","title":"Security update for libgit2","description":"This update for libgit2 fixes the following issues:\n\n - CVE-2023-22742: Verify ssh remote host keys (bsc#1207364)\n","status":"published","published":"2023-04-06T10:34:13Z","modified":"2026-02-04T04:08:26.116277Z","updated_at":"2026-11-02T15:53:52.350754Z"},{"id":"SUSE-SU-2023:1909-1","title":"Security update for libgit2","description":"This update for libgit2 fixes the following issues:\n\n- CVE-2023-22742: Fixed SSH keys verification failure (bsc#1207364).\n","status":"published","published":"2023-04-19T08:55:54Z","modified":"2025-05-02T04:34:35.599341Z","updated_at":"2026-11-02T15:53:52.350754Z"},{"id":"USN-6678-1","title":"libgit2 vulnerabilities","description":"It was discovered that libgit2 mishandled equivalent filenames on NTFS\npartitions. If a user or automated system were tricked into cloning a\nspecially crafted repository, an attacker could possibly use this issue to\nexecute arbitrary code. This issue only affected Ubuntu 16.04 LTS and\nUbuntu 18.04 LTS. (CVE-2020-12278, CVE-2020-12279)\n\nIt was discovered that libgit2 did not perform certificate checking by\ndefault. An attacker could possibly use this issue to perform a\nmachine-in-the-middle attack. This issue only affected Ubuntu 16.04 LTS,\nUbuntu 18.04 LTS, Ubuntu 20.04 LTS, and Ubuntu 22.04 LTS. (CVE-2023-22742)\n\nIt was discovered that libgit2 could be made to run into an infinite loop.\nAn attacker could possibly use this issue to cause a denial of service.\nThis issue only affected Ubuntu 23.10. (CVE-2024-24575)\n\nIt was discovered that libgit2 did not properly manage memory. An attacker\ncould possibly use this issue to cause a denial of service or execute\narbitrary code. (CVE-2024-24577)\n","status":"published","published":"2024-03-05T18:46:35Z","modified":"2026-06-25T13:32:28.756070378Z","updated_at":"2026-11-02T16:58:17.914523Z"}]}}
