/

CVE-2026-114097

Severity:

HIGH RISK

(7.8)

Path Traversal (CWE-22) in Dulwich Branch Filter API

CVE-2026-114097

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write and Potential Code Execution

Severity:

HIGH RISK

(7.8)

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

A path traversal vulnerability in Dulwich's commit filtering logic can cause files to be written outside the intended working directory when symlinks persist across commits.

A repository crafted with a redirecting symlink may enable unauthorized file modification, including placement of files in Git hook locations that could lead to code execution when those hooks run.

A path traversal vulnerability in Dulwich's commit filtering logic can cause files to be written outside the intended working directory when symlinks persist across commits.

A repository crafted with a redirecting symlink may enable unauthorized file modification, including placement of files in Git hook locations that could lead to code execution when those hooks run.

Affected context

The vulnerability occurs in Dulwich versions using CommitFilter._apply_index_filter() during branch filtering. It becomes risky when a repository contains symlinks that persist between commits and the filtering process writes descendant-commit files without sufficiently constraining resolved paths to the working directory.

The vulnerability occurs in Dulwich versions using CommitFilter._apply_index_filter() during branch filtering. It becomes risky when a repository contains symlinks that persist between commits and the filtering process writes descendant-commit files without sufficiently constraining resolved paths to the working directory.

Exploit preconditions

  • Attack surface: Repository processing during branch filtering or related commit transformation operations
  • Required access: Ability to provide or cause processing of a crafted repository
  • Trigger point: File writes performed by CommitFilter._apply_index_filter()
  • Why exploitation is possible: A symlink from an ancestor commit can redirect later file writes outside the intended working directory
  • Additional condition: The destination must be writable by the process, and code execution depends on a written file being subsequently treated as executable, such as a Git hook
  • Attack surface: Repository processing during branch filtering or related commit transformation operations
  • Required access: Ability to provide or cause processing of a crafted repository
  • Trigger point: File writes performed by CommitFilter._apply_index_filter()
  • Why exploitation is possible: A symlink from an ancestor commit can redirect later file writes outside the intended working directory
  • Additional condition: The destination must be writable by the process, and code execution depends on a written file being subsequently treated as executable, such as a Git hook

Why this happens

The underlying bug is insufficient validation of filesystem paths after repository state changes involving symlinks. File operations performed during commit filtering can follow a symlink established by an earlier commit rather than enforcing that the resolved destination remains within the designated working directory.

This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, because attacker-influenced repository content can redirect writes beyond the intended path boundary.

The underlying bug is insufficient validation of filesystem paths after repository state changes involving symlinks. File operations performed during commit filtering can follow a symlink established by an earlier commit rather than enforcing that the resolved destination remains within the designated working directory.

This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, because attacker-influenced repository content can redirect writes beyond the intended path boundary.

Potential impact

  • An attacker may write or overwrite files outside the working directory
  • Repository metadata or operational files could be modified
  • Files in Git hook locations could be created or replaced
  • Code could execute when a modified hook is later invoked
  • Build, deployment, or source-processing workflows could be compromised
  • Integrity of generated files and repository contents could be affected
  • An attacker may write or overwrite files outside the working directory
  • Repository metadata or operational files could be modified
  • Files in Git hook locations could be created or replaced
  • Code could execute when a modified hook is later invoked
  • Build, deployment, or source-processing workflows could be compromised
  • Integrity of generated files and repository contents could be affected

General mitigation guidance

Mitigation typically focuses on enforcing destination boundaries for every filesystem write, including after symlink resolution.

Common defensive patterns include:

  • Resolve and canonicalize destination paths before writing
  • Verify that resolved paths remain beneath an approved working-directory root
  • Treat repository symlinks as untrusted input during filtering operations
  • Reject or isolate symlink-based paths when the workflow does not require them
  • Use filesystem APIs and policies that prevent writes through unexpected links
  • Run repository processing with least privilege and without unnecessary write access to hooks, metadata, or deployment paths
  • Prefer isolated temporary workspaces with narrowly scoped permissions

Mitigation typically focuses on enforcing destination boundaries for every filesystem write, including after symlink resolution.

Common defensive patterns include:

  • Resolve and canonicalize destination paths before writing
  • Verify that resolved paths remain beneath an approved working-directory root
  • Treat repository symlinks as untrusted input during filtering operations
  • Reject or isolate symlink-based paths when the workflow does not require them
  • Use filesystem APIs and policies that prevent writes through unexpected links
  • Run repository processing with least privilege and without unnecessary write access to hooks, metadata, or deployment paths
  • Prefer isolated temporary workspaces with narrowly scoped permissions

How teams detect issues like this

Organizations commonly detect this class of issue through:

  • Static analysis for file writes that concatenate repository paths without canonical containment checks
  • Code review of symlink handling across multi-commit or multi-stage workflows
  • Tests that place symlinks in ancestor states and verify resolved writes remain inside the workspace
  • Runtime monitoring for unexpected writes to Git metadata, hook directories, or paths outside approved workspaces
  • Policy enforcement that restricts repository-processing jobs from modifying executable or deployment-controlled locations
  • Automated security review tools that flag path normalization and symlink-resolution gaps

Organizations commonly detect this class of issue through:

  • Static analysis for file writes that concatenate repository paths without canonical containment checks
  • Code review of symlink handling across multi-commit or multi-stage workflows
  • Tests that place symlinks in ancestor states and verify resolved writes remain inside the workspace
  • Runtime monitoring for unexpected writes to Git metadata, hook directories, or paths outside approved workspaces
  • Policy enforcement that restricts repository-processing jobs from modifying executable or deployment-controlled locations
  • Automated security review tools that flag path normalization and symlink-resolution gaps

Sources

SourceLink
github.comgithub.com/jelmer/dulwich/security/advisories/GHSA-5fqc-mrg8-w798
vulncheck.comvulncheck.com/advisories/dulwich-0.23.1-before-1.2.8-symlink-path-traversal-via-filter-branch-index-filter

Frequently asked

questions

It can be exploitable through repository-processing services or workflows that accept and filter attacker-controlled repositories. Direct remote exploitation depends on whether such a service is exposed and what permissions its processing process has.

The attacker generally needs a way to provide or influence a repository that is processed by the vulnerable filtering operation. The process must also have permission to write to a useful destination.

Enforce canonical path containment for every write, account for symlink resolution, and isolate repository processing in a least-privileged workspace.

Treat repository paths and symlinks as untrusted, add multi-commit symlink regression tests, restrict writes to approved roots, and monitor sensitive filesystem locations for unexpected changes.

It can be exploitable through repository-processing services or workflows that accept and filter attacker-controlled repositories. Direct remote exploitation depends on whether such a service is exposed and what permissions its processing process has.

The attacker generally needs a way to provide or influence a repository that is processed by the vulnerable filtering operation. The process must also have permission to write to a useful destination.

Enforce canonical path containment for every write, account for symlink resolution, and isolate repository processing in a least-privileged workspace.

Treat repository paths and symlinks as untrusted, add multi-commit symlink regression tests, restrict writes to approved roots, and monitor sensitive filesystem locations for unexpected changes.

Find out what's already
exploitable in your codebase.