GHSA-pg4w-g64p-qwhj — gitoxide
GHSA-pg4w-g64p-qwhj is a CWE-59 vulnerability in gitoxide. A fix is available for gitoxide — see the affected versions and patch details below.
gix and gitoxide's symlinked .gitmodules are followed and parsed from outside of the repository
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
Exploitation and automatability from CISA’s SSVC triage for GHSA-pg4w-g64p-qwhj.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Real-World Exposure
gitoxide🦀gixReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
Description
Summary
attachments: pocs.zip
When Repository::submodules() loads submodule metadata, it prefers the worktree .gitmodules file if that path exists. In the current implementation, the path is read with std::fs::read(), which follows symlinks. As a result, a repository can present a symlinked .gitmodules that points outside the repository, and gitoxide will parse the out-of-repository bytes as submodule configuration.
This is a repository-boundary violation. A caller using the high-level submodule API can believe it is reading repository-local submodule metadata, while the bytes are actually coming from an arbitrary file outside the repository tree.
Root cause analysis
The relevant flow is:
gix/src/repository/location.rsderives the worktree.gitmodulespath asworkdir/.gitmodules.gix/src/repository/submodule.rsreads that path withstd::fs::read(&path)and immediately parses the bytes as a submodule configuration file.Repository::submodules()exposes the parsed entries through the high-level API.
The issue is not in the parser. The issue is that the worktree path is treated as an ordinary file without checking whether it is a symlink, and without checking whether the canonicalized target remains inside the repository worktree.
Because std::fs::read() follows symlinks, a malicious repository can cause gitoxide to ingest bytes from an attacker-chosen location outside the repository. The resulting Submodule objects then expose name, path, and url values derived from that external file.
Reproduction steps
Use the attached PoC zip that contains the pocs/ workspace.
-
Unzip the PoC archive.
-
Enter
pocs/F001. -
Run:
cargo run --quiet -
Compare the output with
pocs/F001/result.txt.
Important outputs include:
gitmodules_symlink=.../victim-repo/.gitmodulessymlink_target=.../outside/modules.confparsed_name=symlinkedparsed_path=deps/symlinkedparsed_url=https://attacker.example/symlinked.git
These outputs show that gitoxide parsed the submodule configuration from the symlink target outside the repository, not from repository-local bytes.
Impact
Confirmed impact:
- out-of-repository bytes can be injected into the result of
Repository::submodules(); - callers can be misled about submodule metadata such as
name,path, andurl; - any downstream workflow that uses those values to decide clone, fetch, update, or policy behavior is operating on attacker-controlled data that did not actually originate from the repository tree.
This report does not claim direct command execution from this code path by itself. The demonstrated impact is metadata injection across the repository boundary.
Recommended fix
A safe fix is to stop silently following symlinks for the worktree .gitmodules path in this loading path.
Reasonable options include:
- use
symlink_metadata()/lstatstyle checks and reject symlinked.gitmoduleswhen loading from the worktree; - canonicalize the target and verify that it still resides under the repository worktree before reading it;
- for security-sensitive callers, prefer loading
.gitmodulesfrom the index orHEADtree rather than following the worktree path.
At minimum, the worktree path should not silently follow symlinks to arbitrary external files.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | gitoxide | all versions | 0.52.1cargo update -p gitoxide --precise 0.52.1 |
| 🦀crates.io | gix | all versions | 0.83.0cargo update -p gix --precise 0.83.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for gitoxide, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update gitoxide to 0.52.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-pg4w-g64p-qwhj is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-pg4w-g64p-qwhj can be triaged on real exposure rather than presence alone.
Tailored to GHSA-pg4w-g64p-qwhj. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-pg4w-g64p-qwhj in your dependencies?
O3 Security finds GHSA-pg4w-g64p-qwhj across crates.io dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.