CVE-2024-35197 gix refs and paths with reserved Windows device names access the devices

Medium 5.4 Published Updated

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.

PackageAffectedFixed in
gitoxide crates.ioAll versions0.36.0
gitoxide crates.ioAll versions0.36.0
gitoxide-core crates.ioAll versions0.38.0
gitoxide-core crates.ioAll versions0.38.0
gix crates.ioAll versions0.63.0
gix crates.ioAll versions0.63.0
11 more packages
gix-index crates.ioAll versions0.33.0
gix-index crates.ioAll versions0.33.0
gix-index crates.ioFrom 0.0.0-00.33.0
gix-ref crates.ioAll versions0.44.0
gix-ref crates.ioAll versions0.44.0
gix-ref crates.ioFrom 0.0.0-00.44.0
gix-worktree crates.ioAll versions0.34.0
gix-worktree crates.ioAll versions0.34.0
gix-worktree crates.ioFrom 0.0.0-00.34.0
gix-worktree-state crates.ioAll versions0.11.0
gix-worktree-state crates.ioAll versions0.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.

Is CVE-2024-35197 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free