gitoxide
Affected
- introduced
0, fixed0.52.1(semver)
Fixed versions
0.52.1
Fix
- Fixed version
0.52.1cargo update -p gitoxide --precise 0.52.1
Advisory
Also known as: CVE-2026-82251
gix and gitoxide: unvalidated submodule name traverses out of .git/modules and redirects state() / open() to another repository
Summary
attachments:
pocs.zip
Submodule names coming from .gitmodules are exposed as unvalidated names and are later reused to derive the submodule git directory as:
<superproject common_dir>/modules/<submodule name>
Because the submodule name is joined directly as a filesystem path component, a name such as ../../../escaped-target.git escapes .git/modules after normalization. The current implementation then uses that escaped path in both state() and open().
The updated PoC demonstrates the real sink, not just string construction:
state() reports repository_exists=true for the traversed path;open() returns a repository whose normalized common_dir() matches the attacker-chosen repository outside .git/modules.Root cause analysis
The relevant flow is:
common_dir().join("modules").join(name) with no confinement check.There is no normalization-and-confinement step between “submodule name from configuration” and “filesystem path used for repository existence checks / open.” As a result, traversal segments in the submodule name directly influence which repository path is inspected and opened.
Reproduce steps
Use the attached PoC zip that contains the pocs/ workspace.
pocs/F002. ```
cargo run --quiet
```
pocs/F002/result.txt.Key outputs are:
submodule_name=../../../escaped-target.gitderived_git_dir_raw=.../.git/modules/../../../escaped-target.gitderived_git_dir_normalized=.../artifacts/escaped-target.gitescaped_target=.../artifacts/escaped-target.gitrepository_exists=truesubmodule_opened=trueopened_common_dir_normalized=.../artifacts/escaped-target.gitnormalized_git_dir_matches_target=trueopened_common_dir_matches_target=truetarget_outside_modules_root=trueThese outputs show that gitoxide is not only constructing a traversable path string. It is actually using the escaped path for repository existence checks and for opening a repository object.
Impact
Confirmed impact:
.git/modules/<name> to an attacker-chosen repository path outside .git/modules;Submodule::state() can report repository existence for the wrong repository;Submodule::open() can return a repository object backed by that attacker-chosen path.This is best described as a path-traversal / repository-confusion issue in submodule repository resolution.
This report does not claim command execution from this behavior alone. The demonstrated impact is repository redirection: callers that enumerate, inspect, or operate on submodules can be steered into using the wrong repository.
Recommended fix
Two complementary fixes are advisable:
<common_dir>/modules, - reject names that contain traversal segments, path separators, or any representation that can escape the modules root.In short, submodule names may remain opaque configuration identifiers, but they should not be treated as trusted filesystem subpaths.
High Basis: The source's own band: HIGH
0, fixed 0.52.1 (semver)0.52.1
0.52.1cargo update -p gitoxide --precise 0.52.10, fixed 0.83.0 (semver)0.83.0
0.83.0cargo update -p gix --precise 0.83.0Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0