GHSA-fr8x-3vfx-f45h: gix and gitoxide Unvalidated Submodule Name Traverses Out Vulnerability

HIGH
CWE-22
Published
Advisory Summary

GHSA-fr8x-3vfx-f45h is a HIGH unvalidated submodule name traverses out vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting gix and gitoxide libraries in the crates.io ecosystem. The issue involves unvalidated submodule name traverses out of .git/modules and redirects state() / open() to another repository. Remediation is available by upgrading affected packages to version 0.52.1, 0.83.0.

GHSA-fr8x-3vfx-f45h at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-fr8x-3vfx-f45h
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product gix and gitoxide
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-fr8x-3vfx-f45h

To remediate this vulnerability, upgrade all affected gix and gitoxide dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

gitoxide fixed: 0.52.1
Upgrade gitoxide to 0.52.1
gix fixed: 0.83.0
Upgrade gix to 0.83.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for gitoxide

How to Check if You Are Affected

To determine whether your application is affected by GHSA-fr8x-3vfx-f45h, inspect your project dependencies for gix and gitoxide:

inspect dependencies for gitoxide

Analyze the terminal output to locate any version of gix and gitoxide in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.52.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In gix and gitoxide, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## **Summary** 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`. ## **Root cause analysis** 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. ## **Reproduce steps** 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.git` - `derived_git_dir_raw=.../.git/modules/../../../escaped-target.git` - `derived_git_dir_normalized=.../artifacts/escaped-target.git` - `escaped_target=.../artifacts/escaped-target.git` - `repository_exists=true` - `submodule_opened=true` - `opened_common_dir_normalized=.../artifacts/escaped-target.git` - `normalized_git_dir_matches_target=true` - `opened_common_dir_matches_target=true` - `target_outside_modules_root=true` These 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: - a malicious submodule name can redirect submodule state inspection away from `.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: 1. do not reuse raw submodule names as filesystem path fragments; - either use a validated/sanitized name for filesystem derivation, - or derive the storage path from a safe identifier instead of the user-controlled name; 2. add an explicit confinement check after path derivation; - normalize or canonicalize the candidate path, - verify that the result stays under `<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.

GHSA-fr8x-3vfx-f45h Affected gix and gitoxide Versions

2 component(s)
Fixed Versions:
0.52.10.83.0
Product / Package Ecosystem Affected Versions Fixed Version
gitoxide
crates.io
< 0.52.1
0.52.1
gix
crates.io
< 0.83.0
0.83.0

References

Frequently Asked Questions

What is GHSA-fr8x-3vfx-f45h?
GHSA-fr8x-3vfx-f45h is a security vulnerability in gix and gitoxide involving unvalidated submodule name traverses out of .git/modules and redirects state() / open() to another repository under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which gix and gitoxide versions are affected?
Affected versions include releases prior to 0.52.1, 0.83.0 across affected packages: gitoxide, gix.
What version fixes GHSA-fr8x-3vfx-f45h?
Upgrading to 0.52.1, 0.83.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gitoxide affected?
Yes, gitoxide is affected in releases prior to 0.52.1. Upgrade your dependency to 0.52.1 or later.
Is gix affected?
Yes, gix is affected in releases prior to 0.83.0. Upgrade your dependency to 0.83.0 or later.
What CWE is associated with GHSA-fr8x-3vfx-f45h?
GHSA-fr8x-3vfx-f45h is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check crates.io dependencies for GHSA-fr8x-3vfx-f45h?
Run the dependency tree command: 'inspect dependencies for gitoxide'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-fr8x-3vfx-f45h",
  "modified" : "2026-05-05T19:27:51Z",
  "published" : "2026-05-05T19:27:51Z",
  "aliases" : [ ],
  "summary" : "gix and gitoxide: unvalidated submodule name traverses out of .git/modules and redirects state() / open() to another repository",
  "details" : "## **Summary**\nattachments:\n[pocs.zip](https://github.com/user-attachments/files/26431422/pocs.zip)\n\nSubmodule names coming from `.gitmodules` are exposed as unvalidated names and are later reused to derive the submodule git directory as:\n\n```\n<superproject common_dir>/modules/<submodule name>\n```\n\nBecause 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()`.\n\nThe updated PoC demonstrates the real sink, not just string construction:\n\n- `state()` reports `repository_exists=true` for the traversed path;\n- `open()` returns a repository whose normalized `common_dir()` matches the attacker-chosen repository outside `.git/modules`.\n\n## **Root cause analysis**\n\nThe relevant flow is:\n\n1. [`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.\n2. [`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.\n3. [`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.\n\nThere 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.\n\n## **Reproduce steps**\n\nUse the attached PoC zip that contains the `pocs/` workspace.\n\n1. Unzip the PoC archive.\n2. Enter `pocs/F002`.\n3. Run:\n    \n    ```\n    cargo run --quiet\n    ```\n    \n4. Compare the output with `pocs/F002/result.txt`.\n\nKey outputs are:\n\n- `submodule_name=../../../escaped-target.git`\n- `derived_git_dir_raw=.../.git/modules/../../../escaped-target.git`\n- `derived_git_dir_normalized=.../artifacts/escaped-target.git`\n- `escaped_target=.../artifacts/escaped-target.git`\n- `repository_exists=true`\n- `submodule_opened=true`\n- `opened_common_dir_normalized=.../artifacts/escaped-target.git`\n- `normalized_git_dir_matches_target=true`\n- `opened_common_dir_matches_target=true`\n- `target_outside_modules_root=true`\n\nThese 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.\n\n## **Impact**\n\nConfirmed impact:\n\n- a malicious submodule name can redirect submodule state inspection away from `.git/modules/<name>` to an attacker-chosen repository path outside `.git/modules`;\n- `Submodule::state()` can report repository existence for the wrong repository;\n- `Submodule::open()` can return a repository object backed by that attacker-chosen path.\n\nThis is best described as a path-traversal / repository-confusion issue in submodule repository resolution.\n\nThis 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.\n\n## **Recommended fix**\n\nTwo complementary fixes are advisable:\n\n1. do not reuse raw submodule names as filesystem path fragments;\n    - either use a validated/sanitized name for filesystem derivation,\n    - or derive the storage path from a safe identifier instead of the user-controlled name;\n2. add an explicit confinement check after path derivation;\n    - normalize or canonicalize the candidate path,\n    - verify that the result stays under `<common_dir>/modules`,\n    - reject names that contain traversal segments, path separators, or any representation that can escape the modules root.\n\nIn short, submodule names may remain opaque configuration identifiers, but they should not be treated as trusted filesystem subpaths.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "gitoxide"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.52.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.52.0"
    }
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "gix"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.83.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/GitoxideLabs/gitoxide/security/advisories/GHSA-fr8x-3vfx-f45h"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/GitoxideLabs/gitoxide"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-05T19:27:51Z",
    "nvd_published_at" : null
  }
}