Traversal outside working tree enables arbitrary code execution
### Summary During checkout, gitoxide does not verify that paths point to locations in the working tree. A specially crafted repository can, when cloned, place new files anywhere writable by the application. ### Details Although `gix-worktree-state` checks for collisions with existing files, it does not itself check if a path is really in the working tree when performing a checkout, nor do the path checks in `gix-fs` and `gix-worktree` prevent this. Cloning an untrusted repository containing specially crafted tree or blob names will create new files outside the repository, or inside the repository or a submodule's `.git` directory. The simplest cases are: - A tree named `..` to traverse upward. This facilitates arbitrary code execution because files can be placed in one or more locations where they are likely to be executed soon. - A tree named `.git` to enter a `.git` directory. This facilitates arbitrary code execution because hooks can be installed. A number of alternatives that achieve the same effect are also possible, some of which correspond to specific vulnerabilities that have affected Git in the past: - A tree or blob whose name contains one or more `/`, to traverse upward or downward. For example, even without containing any tree named `..` or `.git`, a repository can represent a file named `../outside` or `.git/hooks/pre-commit`. This is distinct from the more intuitive case a repository containing trees that represent those paths. - In Windows, a tree or blob who
- Products
- gix-worktree
- Affected versions
- Not specified
- Fixed versions
- 0.34.0
- CVEs
- CVE-2024-35186
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 30 Oct 2026, 08:43 UTC · Revision 1
Source evidence
Traversal outside working tree enables arbitrary code execution
core-osv · Original sourcePublished 22 May 2024, 12:00 UTC
### Summary During checkout, gitoxide does not verify that paths point to locations in the working tree. A specially crafted repository can, when cloned, place new files anywhere writable by the application. ### Details Although `gix-worktree-state` checks for collisions with existing files, it does not itself check if a path is really in the working tree when performing a checkout, nor do the path checks in `gix-fs` and `gix-worktree` prevent this. Cloning an untrusted repository containing specially crafted tree or blob names will create new files outside the repository, or inside the repository or a submodule's `.git` directory. The simplest cases are: - A tree named `..` to traverse upward. This facilitates arbitrary code execution because files can be placed in one or more locations where they are likely to be executed soon. - A tree named `.git` to enter a `.git` directory. This facilitates arbitrary code execution because hooks can be installed. A number of alternatives that achieve the same effect are also possible, some of which correspond to specific vulnerabilities that have affected Git in the past: - A tree or blob whose name contains one or more `/`, to traverse upward or downward. For example, even without containing any tree named `..` or `.git`, a repository can represent a file named `../outside` or `.git/hooks/pre-commit`. This is distinct from the more intuitive case a repository containing trees that represent those paths. - In Windows, a tree or blob who
osv:RUSTSEC-2024-0349
gix-worktree
Fixed versions: 0.34.0
Complete source record
{
"id": "657e4027d7ac7590676eb8758d77f3f7024f0062d26fe482d5f0b2c05b02b977",
"url": "https://osv.dev/vulnerability/RUSTSEC-2024-0349",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Traversal outside working tree enables arbitrary code execution",
"summary": "### Summary During checkout, gitoxide does not verify that paths point to locations in the working tree. A specially crafted repository can, when cloned, place new files anywhere writable by the application. ### Details Although `gix-worktree-state` checks for collisions with existing files, it does not itself check if a path is really in the working tree when performing a checkout, nor do the path checks in `gix-fs` and `gix-worktree` prevent this. Cloning an untrusted repository containing specially crafted tree or blob names will create new files outside the repository, or inside the repository or a submodule's `.git` directory. The simplest cases are: - A tree named `..` to traverse upward. This facilitates arbitrary code execution because files can be placed in one or more locations where they are likely to be executed soon. - A tree named `.git` to enter a `.git` directory. This facilitates arbitrary code execution because hooks can be installed. A number of alternatives that achieve the same effect are also possible, some of which correspond to specific vulnerabilities that have affected Git in the past: - A tree or blob whose name contains one or more `/`, to traverse upward or downward. For example, even without containing any tree named `..` or `.git`, a repository can represent a file named `../outside` or `.git/hooks/pre-commit`. This is distinct from the more intuitive case a repository containing trees that represent those paths. - In Windows, a tree or blob who",
"evidence": "osv:RUSTSEC-2024-0349",
"products": [
{
"name": {
"value": "gix-worktree",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "0.34.0",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": []
}
],
"severity": "high",
"structured": {
"id": "RUSTSEC-2024-0349",
"aliases": [
"CVE-2024-35186",
"GHSA-7w47-3wg8-547c",
"RUSTSEC-2024-0348",
"RUSTSEC-2024-0349",
"RUSTSEC-2024-0350"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0.0.0-0"
},
{
"fixed": "0.34.0"
}
]
}
],
"package": {
"name": "gix-worktree",
"purl": "pkg:cargo/gix-worktree",
"ecosystem": "crates.io"
},
"database_specific": {
"cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"source": "https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2024-0349.json",
"categories": [
"code-execution"
],
"informational": null
},
"ecosystem_specific": {
"affects": {
"os": [],
"arch": [],
"functions": []
},
"affected_functions": null
}
}
],
"modified": "2026-10-12T18:00:06.813251209Z",
"provider": "osv",
"references": [
"https://crates.io/crates/gix-worktree",
"https://rustsec.org/advisories/RUSTSEC-2024-0349.html",
"https://github.com/GitoxideLabs/gitoxide/commit/79dce79c62f6072aa2653780d590dc3993dfa401",
"https://github.com/advisories/GHSA-7w47-3wg8-547c",
"https://nvd.nist.gov/vuln/detail/CVE-2024-35186"
],
"provider_metadata": {
"license": "CC0-1.0"
}
},
"related_cves": [
{
"value": "CVE-2024-35186",
"evidence": "/aliases"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 306371,
"published_at": "2024-05-22T12:00:00+00:00"
}