CVE-2024-35197 gix refs and paths with reserved Windows device names access the devices
Attackers can cause denial of service or arbitrary output by using reserved Windows device names in Git repository paths or refs.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2024-35197?
CVE-2024-35197 is a medium-severity path traversal vulnerability in Byron gitoxide, published on 23 May 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
gitoxide is a pure Rust implementation of Git. On Windows, fetching refs that clash with legacy device names reads from the devices, and checking out paths that clash with such names writes arbitrary data to the devices. This allows a repository, when cloned, to cause indefinite blocking or the production of arbitrary message that appear to have come from the application, and potentially other harmful effects under limited circumstances. If Windows is not used, or untrusted repositories are not cloned or otherwise used, then there is no impact. A minor degradation in availability may also be possible, such as with a very large file named `CON`, though the user could interrupt the application.
Weakness: CWE-67
Which versions are affected by CVE-2024-35197?
17 open source packages ship an affected version, including gitoxide, gitoxide-core and gix.
| Package | Affected | Fixed in |
|---|---|---|
gitoxide crates.io | All versions | 0.36.0 |
gitoxide crates.io | All versions | 0.36.0 |
gitoxide-core crates.io | All versions | 0.38.0 |
gitoxide-core crates.io | All versions | 0.38.0 |
gix crates.io | All versions | 0.63.0 |
gix crates.io | All versions | 0.63.0 |
11 more packages
gix-index crates.io | All versions | 0.33.0 |
gix-index crates.io | All versions | 0.33.0 |
gix-index crates.io | From 0.0.0-0 | 0.33.0 |
gix-ref crates.io | All versions | 0.44.0 |
gix-ref crates.io | All versions | 0.44.0 |
gix-ref crates.io | From 0.0.0-0 | 0.44.0 |
gix-worktree crates.io | All versions | 0.34.0 |
gix-worktree crates.io | All versions | 0.34.0 |
gix-worktree crates.io | From 0.0.0-0 | 0.34.0 |
gix-worktree-state crates.io | All versions | 0.11.0 |
gix-worktree-state crates.io | All versions | 0.11.0 |
How do I fix CVE-2024-35197?
Upgrade gitoxide to 0.36.0 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2024-35197 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-35197 exists.
Sources
Also known as GHSA-49jc-r788-3fc9, RUSTSEC-2024-0351, RUSTSEC-2024-0352, RUSTSEC-2024-0353.