# CVE-2023-22742: RUSTSEC-2023-0003 - git2 does not verify SSH keys by default

Source: https://junglewise.ai/threats/cve-2023-22742-git2-rs-fails-to-verify-ssh-keys-by-default  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2023-01-20  
License: CC BY 4.0 with a link back

CVE-2023-22742 · Severity: low · CVSS 3.1 · Published 2023-01-20

git2 does not verify SSH keys by default

Technologies: [git2 (crates.io)](https://junglewise.ai/threats/technologies/git2), [libgit2-sys (crates.io)](https://junglewise.ai/threats/technologies/libgit2-sys). Vendors: [crates.io](https://junglewise.ai/threats/vendors/crates-io).

## Quick answers

**Is CVE-2023-22742 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2023-22742 being exploited in the wild.

**How severe is CVE-2023-22742?** Low severity, with a CVSS score of 3.1, published 20 January 2023.

**Which products and versions are affected?** git2 (crates.io) SEMVER:introduced=0,fixed=0.16.1; libgit2-sys (crates.io) SEMVER:introduced=0.0.0-0,fixed=0.13.5,introduced=0.14.0,fixed=0.14.2, SEMVER:introduced=0.14.0,fixed=0.14.2.

**Is there a fix for CVE-2023-22742?** Yes. git2 (crates.io): upgrade to 0.16.1 or later; libgit2-sys (crates.io): upgrade to 0.14.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2023-22742?** Check whether you run git2 (crates.io) or libgit2-sys (crates.io) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- git2 (crates.io): upgrade to 0.16.1 or later

  ```sh
  cargo update -p git2
  ```

- libgit2-sys (crates.io): upgrade to 0.14.2 or later

  ```sh
  cargo update -p libgit2-sys
  ```


## Affected products

- git2 (crates.io) SEMVER:introduced=0,fixed=0.16.1
- libgit2-sys (crates.io) SEMVER:introduced=0.0.0-0,fixed=0.13.5,introduced=0.14.0,fixed=0.14.2, SEMVER:introduced=0.14.0,fixed=0.14.2

## Identifiers

- CVE-2023-22742
- GHSA-m4ch-rfv5-x5g3
- RUSTSEC-2023-0003

## Related threats

- [RUSTSEC-2026-0184 - Potential undefined behavior with Signature from a buffer-created BlameHunk](https://junglewise.ai/threats/rustsec-2026-0184-potential-undefined-behavior-with-signature-from-a-caaa89e6)
- [RUSTSEC-2026-0183 - Potential undefined behavior when calling Remote::list()](https://junglewise.ai/threats/rustsec-2026-0183-potential-undefined-behavior-when-calling-remote-list-81c95b20)
- [git2 has potential undefined behavior when dereferencing Buf struct](https://junglewise.ai/threats/git2-has-potential-undefined-behavior-when-dereferencing-buf-struct-12fe5959)
- [RUSTSEC-2026-0008 - Potential undefined behavior when dereferencing Buf struct](https://junglewise.ai/threats/rustsec-2026-0008-potential-undefined-behavior-when-dereferencing-buf-6f571e76)
- [libgit2-sys affected by memory corruption, denial of service, and arbitrary code execution in libgit2](https://junglewise.ai/threats/libgit2-sys-affected-by-memory-corruption-denial-of-service-and-f4953ccd)
