# CVE-2024-51990: Path traversal via crafted Git repositories in jj

> Attackers can craft Git repositories to force jj to write files outside the intended directory, potentially modifying system files.

- **Severity:** Critical 9.3 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 7 Nov 2024
- **Updated:** 7 Nov 2024
- **Also known as:** GHSA-88h5-6w7m-5w56, openSUSE-SU-2024:14485-1

## What is CVE-2024-51990?

CVE-2024-51990 is a critical path traversal vulnerability in martinvonz jj, published on 7 Nov 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

jj, or Jujutsu, is a Git-compatible VCS written in rust. In affected versions specially crafted Git repositories can cause `jj` to write files outside the clone. This issue has been addressed in version 0.23.0. Users are advised to upgrade. Users unable to upgrade should avoid cloning repos from unknown sources.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

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

2 open source packages ship an affected version, including jj-lib.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `jj-lib` | crates.io | All versions | 0.23.0 |
| `jj-lib` | crates.io | All versions | 0.23.0 |
| `jujutsu` | openSUSE:Tumbleweed | All versions | 0.23.0-1.1 |

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

Upgrade jj-lib to 0.23.0 or later.

## Is CVE-2024-51990 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2024-51990 is a critical path traversal vulnerability in martinvonz jj, published on 7 Nov 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-51990 exists.

Affected packages and fixed versions:
- jj-lib (crates.io): affected all versions; fixed in 0.23.0
- jj-lib (crates.io): affected all versions; fixed in 0.23.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-51990/ (Markdown: https://insights.sbomify.com/CVE-2024-51990/index.md)
```

## Sources

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

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