CVE-2026-114097 in Dulwich
Summary
by MITRE • 10/22/2026
Dulwich from 0.23.1 before 1.2.8 contains a path traversal vulnerability in CommitFilter._apply_index_filter() that allows attackers to write files outside the working directory via symlinks persisting between commits. Attackers can craft a repository where an ancestor commit's symlink redirects a descendant commit's file writes during filter_branch, enabling code execution by writing into .git/hooks.
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 10/22/2026
The vulnerability identified in Dulwich versions prior to 1.2.8 represents a critical path traversal flaw within the CommitFilter._apply_index_filter() function. This security defect arises from an insufficient validation of file paths during repository manipulation operations, specifically when processing commits that involve symbolic links. The core technical issue lies in the library's handling of symlinks that persist across multiple commits. When a repository contains a symlink created in an ancestor commit, and this link points to a location outside the intended working directory or target structure, subsequent operations such as filter_branch can exploit this persistent reference. During these operations, Dulwich fails to adequately resolve or restrict the destination path of the symbolic link relative to the current context, allowing file write operations to be redirected to arbitrary locations on the filesystem where the process has permissions.
This architectural weakness enables attackers to achieve unauthorized file writes outside the designated working directory boundaries. By crafting a malicious repository with specific symlink configurations in earlier commits, an attacker can manipulate the behavior of descendant commit processing. When a user or automated system performs operations like filtering branches, Dulwich applies filters based on the index state derived from these commits. The flawed logic allows the symlink to act as a bridge, redirecting writes intended for tracked files into unintended directories. This is not merely a read-only information disclosure but an active write primitive that can be leveraged for more severe impacts depending on the context in which Dulwich is executed.
The operational impact of this vulnerability is particularly severe when applied to Git hooks or other executable scripts within the repository structure. An attacker who controls the content of a malicious repository can induce a victim, such as a CI/CD pipeline or developer workstation running an affected version of Dulwich, to write files into sensitive directories like .git/hooks. If successful, this allows for arbitrary code execution on the host system because Git hooks are executed automatically during various git operations. This transforms what might appear as a simple repository corruption issue into a remote code execution vector if combined with social engineering or automated processing pipelines that trust unverified repositories.
From an industry standard perspective, this vulnerability aligns closely with CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal. The failure occurs because the application does not properly neutralize special elements within filenames that can cause paths to be interpreted outside of the intended directory structure. Furthermore, in the context of attack tactics, this flaw facilitates initial access and potential privilege escalation through CWE-94: Improper Control of Generation of Code (Code Injection), specifically via hook execution. The ATT&CK framework would categorize the exploitation phase under T1059: Command and Scripting Interpreter, as the ultimate goal is often to execute arbitrary commands by leveraging trusted scripts like Git hooks that are triggered by normal repository operations.
Mitigation strategies must prioritize immediate software updates. Users of Dulwich should upgrade to version 1.2.8 or later, where this path traversal logic has been corrected to properly validate and restrict symlink targets during index filtering operations. For environments unable to update immediately, operational mitigations include restricting the execution permissions on .git/hooks directories for untrusted repositories and implementing strict input validation at the application layer if Dulwich is embedded in a larger service. Additionally, security teams should audit CI/CD pipelines that automatically process external or user-submitted git repositories to ensure they do not inadvertently trigger dangerous operations like filter_branch against potentially malicious inputs without sandboxing or verification steps.