CVE-2026-114098 in Dulwichinfo

Summary

by MITRE • 10/22/2026

Dulwich from 0.22.5 before 1.2.8 contains a path traversal vulnerability in stash.py pop() that allows attackers to write arbitrary files outside the worktree through intermediate directory symlinks. Attackers can craft a malicious repository whose popped stash writes a payload into .git/hooks/post-checkout, achieving code execution on the next checkout.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 10/22/2026

The Dulwich library, specifically versions prior to 1.2.8 and after 0.22.5, contains a critical path traversal vulnerability within its implementation of the stash pop operation in the stash.py module. This flaw stems from an insufficient validation mechanism when resolving file paths during the restoration of stashed changes. When a user executes a stash pop command on a repository that has been manipulated by an attacker, Dulwich fails to properly canonicalize or restrict the target path relative to the designated worktree directory. Instead of strictly confining write operations within the bounds of the working tree, the library allows intermediate symbolic links to be followed without adequate security checks. This oversight enables an adversary to craft a malicious Git repository where stashed file entries contain paths that traverse outside the intended directory structure using symlink chains.

The technical exploitation vector relies on the ability to create symlinks within the .git directory or the working tree that point to arbitrary locations in the filesystem, such as system directories or other sensitive user files. By carefully constructing a stash entry where one of the restored files is linked through these intermediate symbolic links, an attacker can redirect the file write operation initiated by Dulwich's pop function to any location accessible by the process running the library. This capability effectively bypasses standard Git safety mechanisms that are designed to prevent accidental overwrites or writes outside the repository context. The vulnerability classifies under CWE-22: Improper Limitation of a Pathname to a Restricted Directory, as it allows access to resources beyond the restricted area intended for normal operation.

The operational impact of this vulnerability is severe due to its potential for remote code execution and privilege escalation depending on the user privileges of the victim. A particularly dangerous exploitation scenario involves writing malicious content into the .git/hooks/post-checkout file within a repository controlled by the attacker. When an unsuspecting developer clones or checks out from such a compromised repository, Git automatically executes any scripts present in the hooks directory as part of its standard workflow automation features. By injecting arbitrary code via the path traversal flaw during the stash pop phase, an attacker ensures that their payload is executed with the same privileges as the user running the git command. This transforms what appears to be a routine version control operation into a vector for initial access and subsequent system compromise.

This attack pattern aligns closely with ATT&CK techniques related to Command and Scripting Interpreter abuse, specifically T1059: Command and Scripting Interpreter, where attackers leverage legitimate system tools like Git hooks to execute malicious code without triggering typical security alerts. Furthermore, the use of symbolic links for path manipulation corresponds to T1564.008: Hidden Files and Directories via Symbolic Link, which describes how adversaries hide their artifacts or manipulate file paths to evade detection. The vulnerability highlights a broader class of risks in libraries that handle untrusted repository data, emphasizing the necessity of strict input validation and sandboxing for operations involving filesystem modifications based on external inputs.

To mitigate this risk, organizations must immediately update Dulwich to version 1.2.8 or later, where the path resolution logic has been hardened to prevent traversal through symlinks outside the worktree boundary. Developers integrating Dulwich into their applications should also implement additional defensive measures, such as validating file paths against a whitelist of allowed directories before performing any write operations. It is crucial to treat all repository data from untrusted sources with extreme caution, assuming that metadata and content may be maliciously crafted. Security teams should monitor for unusual git hook executions or unexpected file modifications in system directories, which could indicate an attempted exploitation of this vulnerability. Regular audits of dependencies and adherence to secure coding practices are essential to prevent similar path traversal issues in other components handling filesystem interactions.

Responsible

VulnCheck

Reservation

10/20/2026

Disclosure

10/22/2026

Moderation

accepted

EPSS

0.00152

KEV

no

Activities

very low

Sources

Want to stay up to date on a daily basis?

Enable the mail alert feature now!