Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-114098 Overview
CVE-2026-114098 is a path traversal vulnerability [CWE-22] in Dulwich, a pure-Python implementation of the Git file formats and protocols. The flaw resides in the pop() function within stash.py and affects versions from 0.22.5 before 1.2.8. Attackers can craft a malicious repository that uses intermediate directory symlinks to redirect stash restoration writes outside the worktree. The most direct exploitation path writes an attacker-controlled payload into .git/hooks/post-checkout, which Git automatically executes on the next checkout operation, yielding arbitrary code execution in the context of the user running Dulwich.
Critical Impact
Successful exploitation leads to arbitrary file write and reliable local code execution when a victim applies a stash from a malicious repository.
Affected Products
- Dulwich versions 0.22.5 through versions prior to 1.2.8
- Applications and tooling that embed Dulwich for Git repository operations
- Developer workstations and CI runners that process untrusted Git repositories with Dulwich
Discovery Timeline
- 2026-10-21 - CVE-2026-114098 published to NVD
- 2026-10-21 - Last updated in NVD database
Technical Details for CVE-2026-114098
Vulnerability Analysis
The vulnerability exists in Dulwich's stash restoration logic, specifically the pop() method in stash.py. When a stash is popped, Dulwich iterates over tracked blob entries and writes them to paths derived from entries recorded in the stash commit. The implementation resolves destination paths without validating that intermediate path components resolve inside the worktree root. When one of those components is a symbolic link that points outside the worktree, Dulwich follows it and writes the blob content to the resolved target. This allows arbitrary file writes anywhere the user process can access on disk.
Root Cause
The root cause is missing canonicalization and containment checks on resolved file paths during stash extraction. Dulwich trusts that path components in a stash entry stay within the repository worktree, but it does not call a safe path-join routine that rejects traversal through symlinks. Because Git treats symlinks as versioned content, a crafted repository can commit a symlink such as payload -> ../../.git/hooks and then stash a file inside that directory, converting the stash entry into an out-of-tree write primitive.
Attack Vector
Exploitation requires a victim to clone or interact with an attacker-controlled repository and invoke Dulwich's stash pop operation. The attacker crafts the repository so that a stash entry resolves through an intermediate symlink into .git/hooks/. The popped blob contains an executable script written to .git/hooks/post-checkout. Git invokes that hook automatically on the next checkout operation, running the attacker's payload with the privileges of the user. The attack vector is local and requires user interaction, consistent with the CVSS metrics for this CVE.
No verified public proof-of-concept code was available at the time of publication. Refer to the GitHub Security Advisory and the VulnCheck Path Traversal Advisory for additional technical detail.
Detection Methods for CVE-2026-114098
Indicators of Compromise
- Unexpected files appearing under .git/hooks/, especially post-checkout, post-merge, or pre-commit, immediately after a stash pop operation.
- Symlinks committed inside untrusted repositories that resolve to paths such as ../../.git/, ../../../etc/, or user configuration directories.
- Dulwich-based tools writing files outside the current worktree path during normal stash operations.
Detection Strategies
- Scan repositories for tracked symlinks whose targets contain .. sequences before running Dulwich operations.
- Audit filesystem telemetry on developer workstations and CI runners for process writes from Python interpreters into .git/hooks/ paths they do not own.
- Alert on execution of newly created hook scripts shortly after Git or Dulwich activity on the same host.
Monitoring Recommendations
- Monitor endpoint telemetry for Python processes writing executable files into Git hook directories.
- Track Dulwich package versions across developer and build environments and flag installs in the vulnerable 0.22.5–1.2.7 range.
- Correlate repository clone events on CI runners with subsequent child process execution originating from .git/hooks/.
How to Mitigate CVE-2026-114098
Immediate Actions Required
- Upgrade Dulwich to version 1.2.8 or later on all systems that process Git repositories.
- Inventory tools and services that embed Dulwich, including internal CI tooling, and patch transitive dependencies.
- Avoid running stash pop with Dulwich against repositories from untrusted sources until patched.
Patch Information
The maintainers fixed the issue in Dulwich 1.2.8. The fix enforces that resolved stash entry paths remain inside the worktree and rejects writes that traverse symlinks pointing outside the repository root. Review the GitHub Security Advisory GHSA-cm62-gvxx-vmxx for commit references and release notes.
Workarounds
- Do not execute stash pop with Dulwich on repositories whose contents are not fully trusted.
- Run Dulwich-based tooling inside sandboxed containers with no write access to host paths outside the working directory.
- Strip or reject symlinks from incoming repositories at ingest time in automated pipelines until Dulwich is upgraded.
# Configuration example
pip install --upgrade "dulwich>=1.2.8"
python -c "import dulwich, sys; sys.exit(0 if tuple(int(x) for x in dulwich.__version__.split('.')[:3]) >= (1,2,8) else 1)"
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

