# CVE-2024-32884: gix-transport indirect code execution via malicious username

> Attackers can achieve arbitrary code execution by crafting a malicious Git clone URL that injects SSH options, requiring a specific local file setup.

- **Severity:** Medium 6.4 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 26 Apr 2024
- **Updated:** 2 Aug 2024
- **Also known as:** AZL-40229, AZL-40264, GHSA-98p4-xjmm-8mfh, RUSTSEC-2024-0335

## What is CVE-2024-32884?

CVE-2024-32884 is a medium-severity command injection vulnerability in Byron gitoxide, published on 26 Apr 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

gitoxide is a pure Rust implementation of Git. `gix-transport` does not check the username part of a URL for text that the external `ssh` program would interpret as an option. A specially crafted clone URL can smuggle options to SSH. The possibilities are syntactically limited, but if a malicious clone URL is used by an application whose current working directory contains a malicious file, arbitrary code execution occurs. This is related to the patched vulnerability GHSA-rrjw-j4m2-mf34, but appears less severe due to a greater attack complexity. This issue has been patched in versions 0.35.0, 0.42.0 and 0.62.0.

Weakness: CWE-88 (Improper Neutralization of Argument Delimiters in a Command), CWE-77 (Improper Neutralization of Special Elements used in a Command)

## Which versions are affected by CVE-2024-32884?

7 open source packages ship an affected version, including gitoxide, gix and gix-transport.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `gitoxide` | crates.io | All versions | 0.35 |
| `gitoxide` | crates.io | All versions | 0.35 |
| `gix` | crates.io | All versions | 0.62 |
| `gix` | crates.io | All versions | 0.62 |
| `gix-transport` | crates.io | All versions | 0.42.0 |
| `gix-transport` | crates.io | All versions | 0.42.0 |
| `gix-transport` | crates.io | From 0.0.0-0 | 0.42.0 |

## How do I fix CVE-2024-32884?

Upgrade gitoxide to 0.35 or later.

## Is CVE-2024-32884 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-32884 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-32884 and fix it if it is affected.

What it is: CVE-2024-32884 is a medium-severity command injection vulnerability in Byron gitoxide, published on 26 Apr 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-32884 exists.

Affected packages and fixed versions:
- gitoxide (crates.io): affected all versions; fixed in 0.35
- gitoxide (crates.io): affected all versions; fixed in 0.35
- gix (crates.io): affected all versions; fixed in 0.62
- gix (crates.io): affected all versions; fixed in 0.62
- gix-transport (crates.io): affected all versions; fixed in 0.42.0
- gix-transport (crates.io): affected all versions; fixed in 0.42.0
- gix-transport (crates.io): affected from 0.0.0-0; fixed in 0.42.0

Task:
1. 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.
2. 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.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-32884/ (Markdown: https://insights.sbomify.com/CVE-2024-32884/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-32884
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-32884
- OSV: https://osv.dev/vulnerability/CVE-2024-32884

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-32884/
Summaries are generated and may contain mistakes; the official description above is the record.
