gix and gitoxide: unvalidated submodule name traverses out of .git/modules and redirects state() / open() to another repository
attachments:
[pocs.zip](https://github.com/user-attachments/files/26431422/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.The relevant flow is:
1. [gix-submodule/src/access.rs](https://github.com/GitoxideLabs/gitoxide/blob/v0.52.0/gix-submodule/src/access.rs) exposes unvalidated submodule names from configuration.
2. [gix/src/submodule/mod.rs](https://github.com/GitoxideLabs/gitoxide/blob/v0.52.0/gix/src/submodule/mod.rs) derives the git directory by doing common_dir().join("modules").join(name) with no confinement check.
3. [gix/src/submodule/mod.rs](https://github.com/GitoxideLabs/gitoxide/blob/v0.52.0/gix/src/submodule/mod.rs) uses that derived path during state resolution and repository opening.
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.
Use the attached PoC zip that contains the pocs/ workspace.
1. Unzip the PoC archive.
2. Enter pocs/F002.
3. Run:
```
cargo run --quiet
```
4. Compare the output with 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.
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.
Two complementary fixes are advisable:
1. do not reuse raw submodule names as filesystem path fragments;
2. add an explicit confinement check after path derivation;
<common_dir>/modules,In short, submodule names may remain opaque configuration identifiers, but they should not be treated as trusted filesystem subpaths.
This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. Rated impact: confidentiality high, integrity none, availability none.
The score comes from this vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:P
GHSA-fr8x-3vfx-f45h is classified as CWE-22: Path Traversal. A file path built from user input is not confined to the intended directory, letting an attacker reach files elsewhere on the filesystem.
GHSA-fr8x-3vfx-f45h is recorded against 2 packages.
Published on 5 May 2026 and last revised on 8 May 2026. No public exploit is currently recorded for this entry. Record sourced from OSV.
github.com (Web)
github.com (Package)
gitoxide has other advisories on record. If you are patching this one, these are worth checking on the same host:
These advisories are the same class of weakness (CWE-22: Path Traversal) in other software:
Details
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:P
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| gitoxide | — | — |
| gix | — | — |
References
Similar Threats
Site Security Check
GHSA-fr8x-3vfx-f45h is rated CVSS 8.0 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.
Scan My Site Free →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.
Stay up to date with the latest from Boteraser.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.
Service URL: developers.cloudflare.com (opens in a new window)
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy Policy.