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-114097 Overview
CVE-2026-114097 is a path traversal vulnerability in Dulwich, a pure-Python implementation of Git. The flaw affects versions 0.23.1 through 1.2.7 and resides in the CommitFilter._apply_index_filter() function. Attackers craft a malicious repository where an ancestor commit introduces a symlink that persists across the index between commits. When filter_branch processes a descendant commit, file writes follow the symlink and land outside the working directory. Writing into .git/hooks yields arbitrary code execution the next time Git invokes a hook. The issue is tracked as CWE-22.
Critical Impact
A crafted repository processed by dulwich.porcelain.filter_branch can write attacker-controlled files into .git/hooks, resulting in code execution on the host running the operation.
Affected Products
- Dulwich 0.23.1 through versions before 1.2.8
- Python tooling and services that invoke Dulwich filter_branch on untrusted repositories
- CI/CD pipelines using Dulwich for Git history rewriting
Discovery Timeline
- 2026-10-21 - CVE-2026-114097 published to NVD
- 2026-10-22 - Last updated in NVD database
Technical Details for CVE-2026-114097
Vulnerability Analysis
Dulwich implements Git operations in pure Python, including repository history rewriting through dulwich.porcelain.filter_branch. The CommitFilter._apply_index_filter() routine materializes each commit's tree into a working directory before applying the user-supplied index filter. The routine fails to clear or validate symlinks introduced by earlier commits in the rewritten history.
An attacker commits a symlink such as evil -> ../../.git/hooks in an ancestor commit. A later commit then writes a regular file at the path evil/post-checkout. During filter_branch replay, Dulwich writes through the persisted symlink, placing the payload inside .git/hooks/post-checkout. The next Git hook invocation executes the attacker's script with the privileges of the user running the filter operation.
Root Cause
The root cause is improper neutralization of filesystem links during tree checkout between commits. _apply_index_filter() does not remove or re-validate symlink entries carried over from previously processed commits, so writes resolve through attacker-controlled link targets. This is a classic path traversal pattern enabled by symlink persistence across checkout iterations.
Attack Vector
Exploitation requires a local user to run filter_branch against a malicious repository. The attacker delivers the repository through cloning, archive extraction, or an automated workflow that processes third-party repositories. User interaction is required to initiate the filter operation, but no authentication to the Dulwich process is needed. Successful exploitation yields high impact to confidentiality, integrity, and availability on the host.
No verified public exploit code is available at publication time. The vulnerability mechanism is described in prose; see the GitHub Security Advisory GHSA-5fqc-mrg8-w798 and the VulnCheck Advisory on Dulwich for technical specifics.
Detection Methods for CVE-2026-114097
Indicators of Compromise
- Unexpected executable files appearing under .git/hooks/ such as post-checkout, post-commit, or pre-push after running filter_branch.
- Repository commits containing symlink tree entries whose targets resolve outside the working directory, for example ../../.git/.
- Child processes spawned by Git immediately after filter_branch or subsequent checkout operations.
Detection Strategies
- Scan repositories for symlink objects referencing .. sequences before invoking filter_branch or other history-rewriting tools.
- Hash and baseline the contents of .git/hooks/ directories across build agents and alert on deviations.
- Monitor process ancestry where Python processes running Dulwich spawn shells or interpreters shortly after repository operations.
Monitoring Recommendations
- Collect file creation telemetry under .git/hooks/ on CI runners and developer workstations.
- Log all invocations of dulwich.porcelain.filter_branch with the source repository URL and operator identity.
- Correlate symlink creation events with subsequent writes resolving to paths outside the working tree.
How to Mitigate CVE-2026-114097
Immediate Actions Required
- Upgrade Dulwich to version 1.2.8 or later on all systems, including build agents, developer endpoints, and container images.
- Audit automated pipelines that run filter_branch against untrusted repositories and pause them until patched.
- Inspect .git/hooks/ directories on hosts that recently processed external repositories for unauthorized scripts.
Patch Information
The fix is included in Dulwich 1.2.8. Install the fixed release with pip install --upgrade "dulwich>=1.2.8". Refer to the GitHub Security Advisory GHSA-5fqc-mrg8-w798 for release notes and commit references.
Workarounds
- Avoid running filter_branch or equivalent history-rewriting operations against repositories from untrusted sources until upgraded.
- Execute Dulwich operations inside ephemeral, unprivileged sandboxes or containers with no access to host credentials or sensitive paths.
- Strip or reject commits containing symlinks pointing outside the working directory before invoking filter_branch.
# Configuration example
pip install --upgrade "dulwich>=1.2.8"
python -c "import dulwich; print(dulwich.__version__)"
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

