/

CVE-2026-82251

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in gitoxide Submodule Paths

CVE-2026-82251

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Repository Confusion and Unauthorized Repository Inspection

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

gitoxide before 0.52.1 does not adequately validate submodule names read from .gitmodules, allowing traversal segments to influence the location of derived submodule Git directories. If an attacker can supply or cause processing of a repository containing a malicious submodule configuration, repository inspection may be redirected to attacker-controlled repositories outside the expected .git/modules directory.

Affected context

The vulnerability occurs when gitoxide processes repository submodules and derives Git directory paths from names in .gitmodules. Deployments and tools that inspect untrusted repositories may be exposed when submodule names are accepted without canonicalization and boundary validation, allowing derived paths to escape the intended .git/modules location.

Exploit preconditions

  • Attack surface: Repository-processing functionality that reads .gitmodules and resolves submodule Git directories
  • Required access: Ability to provide, modify, or induce processing of a repository containing attacker-controlled submodule configuration
  • Trigger point: Calls to submodule-related state() or open() operations
  • Why exploitation is possible: Unvalidated traversal segments can alter the derived repository path and redirect resolution outside the intended submodule storage directory

Why this happens

The underlying bug is insufficient validation of filesystem path components derived from repository metadata. Submodule names are treated as trustworthy path inputs without ensuring that the resulting path remains within the designated .git/modules directory. This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, because attacker-influenced path data can escape its intended filesystem boundary.

Potential impact

  • Repository state inspection may be redirected to attacker-controlled content
  • Applications may confuse an external repository with the expected submodule repository
  • Sensitive repository metadata could be exposed if accessible through the redirected path
  • Repository automation or analysis results could be influenced by unexpected repository contents
  • Downstream security checks could be weakened by inspecting the wrong repository state

General mitigation guidance

Mitigation generally focuses on treating submodule names and repository metadata as untrusted path input.

Common defensive patterns include:

  • Canonicalizing and validating derived paths before opening or inspecting repositories
  • Enforcing that resolved paths remain beneath the intended .git/modules directory
  • Rejecting absolute paths, traversal components, and ambiguous path representations
  • Using secure-by-default path-resolution helpers with explicit directory-boundary checks
  • Separating untrusted repository processing from sensitive local repositories
  • Running repository analysis with least-privilege filesystem access and isolated working directories
  • Reducing trust in repository-provided configuration and applying validation before filesystem access

How teams detect issues like this

Detection can include static analysis and code review for filesystem paths constructed from .gitmodules values without canonicalization or containment checks. Reviewers can look for direct concatenation of repository metadata with filesystem paths, path normalization performed after access, and APIs that open repositories before validating their resolved locations. Policy enforcement can require repository-processing code to use approved boundary-checking utilities and can add tests for traversal, absolute-path, symlink, and normalization edge cases. Automated security review tools may help identify path construction and missing validation patterns.

Sources

SourceLink
github.comgithub.com/GitoxideLabs/gitoxide/security/advisories/GHSA-fr8x-3vfx-f45h
vulncheck.comvulncheck.com/advisories/gitoxide-before-0.52.1-path-traversal-via-submodule-name

Frequently asked

questions

It can affect remote or automated repository-processing workflows when an attacker can supply a repository or modify its .gitmodules configuration. Direct exploitation still depends on an application processing that repository.

The attacker generally needs to control or influence repository metadata that gitoxide will read. They do not necessarily need local access to the victim's filesystem.

Validate and canonicalize every derived submodule path, then enforce that it remains within the intended .git/modules directory before opening or inspecting it.

Treat repository metadata as untrusted input, use constrained path-resolution APIs, test filesystem-boundary conditions, and apply least-privilege isolation to repository analysis workflows.

Find out what's already
exploitable in your codebase.