{"answers":{"affected":"7 open source packages ship an affected version, including libgit2-sys and git2. It affects 1 product.","exploited":"There is no known exploitation of CVE-2023-22742 in the wild and no public exploit code.","fix":"Upgrade libgit2-sys to a fixed version for your release line: 0.13.5 or 0.14.2.","what":"CVE-2023-22742 is a medium-severity vulnerability in libgit2, published on 20 Jan 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2023-22742 and fix it if it is affected.\n\nWhat it is: CVE-2023-22742 is a medium-severity vulnerability in libgit2, published on 20 Jan 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2023-22742 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- libgit2-sys (crates.io): affected all versions; fixed in 0.13.5\n- libgit2-sys (crates.io): affected all versions; fixed in 0.13.5\n- libgit2-sys (crates.io): affected from 0.0.0-0; fixed in 0.13.5, 0.14.2\n- libgit2-sys (crates.io): affected from 0.14.0; fixed in 0.14.2\n- libgit2-sys (crates.io): affected from 0.14.0; fixed in 0.14.2\n- git2 (crates.io): affected all versions; fixed in 0.16.1\n- git2 (crates.io): affected all versions; fixed in 0.16.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2023-22742/ (Markdown: https://insights.sbomify.com/CVE-2023-22742/index.md)","id":"CVE-2023-22742","markdown":"https://insights.sbomify.com/CVE-2023-22742/index.md","name":"CVE-2023-22742","record":{"aliases":["AZL-13175","DEBIAN-CVE-2023-22742","GHSA-8643-3wh5-rmjq","GHSA-m4ch-rfv5-x5g3","JLSEC-2025-184","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","openSUSE-SU-2024:12632-1"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["security_bypass"],"network_reachable":"yes","non_default_config":false,"product_category":"Git library","requires_auth":"none","summary":"libgit2 fails to verify SSH keys by default, allowing man-in-the-middle attacks unless a certificate check callback is explicitly configured.","user_interaction":"required","vuln_class":"security_feature_bypass"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"libgit2","vendor":"libgit2"}],"cvss":{"score":5.3,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-347","name":"Improper Verification of Cryptographic Signature"}],"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.","ecosystems":["SUSE:Linux Enterprise Module for Development Tools 15 SP4","SUSE:Linux Enterprise Real Time 15 SP3","SUSE:Manager Server Module 4.2","SUSE:Manager Server Module 4.3","crates.io","openSUSE:Leap 15.4","openSUSE:Tumbleweed"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"libgit2 fails to verify SSH keys by default","id":"CVE-2023-22742","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"security_feature_bypass","year":"2023"},"n_packages":15,"n_references":7,"next":{"headline":"Git for Windows' installer is susceptible to DLL side loading attacks","id":"CVE-2023-22743"},"packages":[{"ecosystem":"crates.io","fixed":["0.16.1"],"introduced":["0"],"last_affected":[],"package":"git2","purl":null,"source":"GHSA-m4ch-rfv5-x5g3"},{"ecosystem":"crates.io","fixed":["0.16.1"],"introduced":["0"],"last_affected":[],"package":"git2","purl":"pkg:cargo/git2","source":"GHSA-m4ch-rfv5-x5g3"},{"ecosystem":"crates.io","fixed":["0.13.5"],"introduced":["0"],"last_affected":[],"package":"libgit2-sys","purl":null,"source":"GHSA-m4ch-rfv5-x5g3"},{"ecosystem":"crates.io","fixed":["0.13.5"],"introduced":["0"],"last_affected":[],"package":"libgit2-sys","purl":"pkg:cargo/libgit2-sys","source":"GHSA-m4ch-rfv5-x5g3"},{"ecosystem":"crates.io","fixed":["0.13.5","0.14.2"],"introduced":["0.0.0-0","0.14.0"],"last_affected":[],"package":"libgit2-sys","purl":"pkg:cargo/libgit2-sys","source":"RUSTSEC-2023-0003"},{"ecosystem":"crates.io","fixed":["0.14.2"],"introduced":["0.14.0"],"last_affected":[],"package":"libgit2-sys","purl":null,"source":"GHSA-m4ch-rfv5-x5g3"},{"ecosystem":"crates.io","fixed":["0.14.2"],"introduced":["0.14.0"],"last_affected":[],"package":"libgit2-sys","purl":"pkg:cargo/libgit2-sys","source":"GHSA-m4ch-rfv5-x5g3"},{"ecosystem":"SUSE:Linux Enterprise Module for Development Tools 15 SP4","fixed":["1.3.0-150400.3.6.1"],"introduced":["0"],"last_affected":[],"package":"libgit2","purl":"pkg:rpm/suse/libgit2\u0026distro=SUSE%20Linux%20Enterprise%20Module%20for%20Development%20Tools%2015%20SP4","source":"SUSE-SU-2023:1788-1"},{"ecosystem":"SUSE:Linux Enterprise Real Time 15 SP3","fixed":["0.28.4-150200.3.6.1"],"introduced":["0"],"last_affected":[],"package":"libgit2","purl":"pkg:rpm/suse/libgit2\u0026distro=SUSE%20Linux%20Enterprise%20Real%20Time%2015%20SP3","source":"SUSE-SU-2023:1909-1"},{"ecosystem":"SUSE:Manager Server Module 4.2","fixed":["0.28.4-150200.3.6.1"],"introduced":["0"],"last_affected":[],"package":"libgit2","purl":"pkg:rpm/suse/libgit2\u0026distro=SUSE%20Manager%20Server%20Module%204.2","source":"SUSE-SU-2023:1909-1"},{"ecosystem":"SUSE:Manager Server Module 4.3","fixed":["0.28.4-150200.3.6.1"],"introduced":["0"],"last_affected":[],"package":"libgit2","purl":"pkg:rpm/suse/libgit2\u0026distro=SUSE%20Manager%20Server%20Module%204.3","source":"SUSE-SU-2023:1909-1"},{"ecosystem":"openSUSE:Leap 15.4","fixed":["0.26.8-150000.3.18.1"],"introduced":["0"],"last_affected":[],"package":"libgit2","purl":"pkg:rpm/opensuse/libgit2\u0026distro=openSUSE%20Leap%2015.4","source":"SUSE-SU-2023:1570-1"},{"ecosystem":"openSUSE:Leap 15.4","fixed":["0.28.4-150200.3.6.1"],"introduced":["0"],"last_affected":[],"package":"libgit2","purl":"pkg:rpm/opensuse/libgit2\u0026distro=openSUSE%20Leap%2015.4","source":"SUSE-SU-2023:1909-1"},{"ecosystem":"openSUSE:Leap 15.4","fixed":["1.3.0-150400.3.6.1"],"introduced":["0"],"last_affected":[],"package":"libgit2","purl":"pkg:rpm/opensuse/libgit2\u0026distro=openSUSE%20Leap%2015.4","source":"SUSE-SU-2023:1788-1"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["1.5.1-1.1"],"introduced":["0"],"last_affected":[],"package":"libgit2","purl":"pkg:rpm/opensuse/libgit2\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2024:12632-1"}],"prev":{"headline":"heap-over-flow in stun_parse_attribute in sofia-sip","id":"CVE-2023-22741"},"products":["libgit2"],"published":"2023-01-20","related":[{"cvss_score":8.6,"headline":"libgit2 is vulnerable to arbitrary code execution due to heap corruption in `git_index_add`","id":"CVE-2024-24577","kev_date_added":null,"published":"2024-02-06"},{"cvss_score":7.5,"headline":"libgit2 is vulnerable to a denial of service attack in `git_revparse_single`","id":"CVE-2024-24575","kev_date_added":null,"published":"2024-02-06"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"open","licence":"CC0 1.0","name":"RustSec","prefix":"RUSTSEC"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"SUSE"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"openSUSE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-03-10","vendors":["libgit2"]},"summary":"libgit2 fails to verify SSH keys by default, allowing man-in-the-middle attacks unless a certificate check callback is explicitly configured.","url":"https://insights.sbomify.com/CVE-2023-22742/"}