Skip to main content

Dulwich CVE-2026-42305

HIGH
Path Traversal (CWE-22)
2026-05-28 https://github.com/jelmer/dulwich GHSA-897w-fcg9-f6xj
8.8
CVSS 3.1 · Vendor: https://github.com/jelmer/dulwich
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker crafts repo with .git\hooks\pre-commit.exe tree entry
  2. Delivery
    Publishes repo or PR to victim-accessible location
  3. Exploit
    Victim clones/fetches via Dulwich on Windows
  4. Execution
    Dulwich writes file into real .git/hooks directory
  5. Persist
    Victim runs git commit
  6. Impact
    Hook executes attacker code in user context

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires three concrete conditions: (1) the victim host runs Windows with NTFS - POSIX clones treat \ as a literal filename byte and are not directly exploitable; (2) the victim uses Dulwich (CLI, porcelain.clone, or any downstream tool built on Dulwich) at version >= 0.10.0 and < 1.2.5 to clone, fetch, or check out the attacker-controlled repository, satisfying the CVSS UI:R user-interaction requirement; and (3) for the .git/hooks/pre-commit.exe primitive to fire, the victim must subsequently run git commit (or any operation that invokes the planted hook), though the ..\outside.txt variant escapes the work tree without that follow-on action. No authentication is required (PR:N) and no special server-side configuration is needed - the victim's Dulwich installation accepts the malicious tree entries by default. Setting core.protectNTFS=true is NOT a limiting factor because affected versions silently ignored that setting due to the wrong option-name lookup.

Impact

Real-world risk is moderate-to-high but contextually narrow. The CVSS 8.8 vector (AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H) accurately reflects that exploitation requires user interaction (the victim must clone/fetch/checkout an attacker-controlled repository) but no authentication, and yields full CIA impact via code execution in the user's context. EPSS data was not provided so probabilistic exploitation likelihood is unknown, and the issue is not in CISA KEV - so this is no public exploit identified at time of analysis rather than confirmed active exploitation. The vulnerability class is well-understood (analogous to Git's CVE-2019-1353 and CVE-2019-1354) and a working POC would be straightforward for any attacker who reads the advisory, so the realistic priority is high for any organization running Dulwich-based tooling on Windows developer or CI hosts; POSIX-only deployments are not directly exploitable but can act as carriers.

Exploit ScenarioDerived

An attacker publishes or pull-requests a Git repository containing a tree entry named .git\hooks\pre-commit.exe (or uses .git::$INDEX_ALLOCATION or a git~2 8.3 alias to bypass .git protections). A Windows developer or CI job clones the repository using Dulwich-based tooling, at which point Dulwich materializes the malicious filename as a nested path inside the real .git/hooks directory; the attacker's executable then runs in the victim's user context on the next git commit, yielding arbitrary code execution. No public exploit identified at time of analysis, but the technique is closely modeled on the well-publicized Git CVE-2019-1353/1354 class, making POC reconstruction straightforward.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 28, 2026

Arbitrary file write leading to remote code execution in Dulwich (pure-Python Git implementation) versions >= 0.10.0 and < 1.2.5 allows attackers controlling a Git repository to plant files inside a Windows victim's .git directory - most notably .git/hooks/pre-commit.exe - which executes on the next commit. The flaw stems from the NTFS path-element validator accepting Windows-hostile bytes (\, :, and git~<n> 8.3 short-name aliases) plus broken handling of core.protectNTFS/core.protectHFS configuration. No public exploit identified at time of analysis, and the issue is not listed in CISA KEV, but the technique is closely modeled on the well-documented Git CVE-2019-1353/1354 class.

RemediationAI

The primary fix is to upgrade to the vendor-released patch Dulwich 1.2.5 or later (release notes at https://github.com/jelmer/dulwich/releases/tag/dulwich-1.2.5), which rejects \, :, and all git~<digits> 8.3 short-name forms in validate_path_element_ntfs, defaults core.protectNTFS to true on every platform, and reads core.protectNTFS/core.protectHFS under their correct option names. There is no effective pre-patch workaround because pre-fix versions silently ignore core.protectNTFS, so setting that config flag has no effect; the vendor advisory explicitly states this. If immediate upgrade is impossible, the only viable compensating control is operational: prohibit cloning, fetching, or checking out untrusted repositories with Dulwich on Windows hosts (including developer workstations and Windows CI agents), and route any necessary untrusted-repo handling through native git on POSIX systems, accepting the productivity cost of restricting Windows-based Dulwich workflows. Inventory downstream tools that vendor Dulwich (build systems, IDE plugins, CI runners) and pin them to versions that depend on Dulwich >= 1.2.5.

Affected Packages

pypi dulwich fix: 1.2.5

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Dulwich is a pure-Python implementation of the Git object/protocol stack, commonly used by porcelain.clone, downstream tools, and CI systems that need Git access without the native git binary. The vulnerability is a classic CWE-22 path traversal/injection in tree-entry validation: validate_path_element_ntfs failed to reject the Windows path separator (\), the NTFS alternate-data-stream marker (:), and 8.3 short-name aliases of .git (only the literal git~1 was blocked, while git~2, git~10, GIT~1, etc. slipped through). Compounding bugs caused core.protectNTFS and core.protectHFS to be read under wrong option names so user-set values were silently ignored, and core.protectNTFS only defaulted to true on Windows rather than universally as upstream Git has done since CVE-2019-1353. The CPE pkg:pip/dulwich confirms the affected distribution is the PyPI package.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/jelmer/dulwich) PRIMARY 8.8 HIGH
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Red Hat 8.8 HIGH

Primary rating from Vendor (https://github.com/jelmer/dulwich).

CVSS VectorVendor: https://github.com/jelmer/dulwich

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

DescriptionCVE.org

Impact

Arbitrary file write leading to remote code execution when cloning or checking out a malicious Git repository on Windows.

Dulwich's path-element validator accepted tree entries whose filenames contained bytes that Windows interprets as structural path syntax:

  • \ - the Windows path separator. A single tree entry named .git\hooks\pre-commit.exe was treated as one valid filename on POSIX but materialized as nested directories .git/hooks/pre-commit.exe on Windows, planting a file inside the victim's .git directory. Git for Windows then

executes that hook on the next git commit, giving the attacker arbitrary code execution in the victim's user context. The same primitive can be used with ..\outside.txt to escape the work tree.

  • : - the NTFS alternate-data-stream marker. .git::$INDEX_ALLOCATION writes directly into the victim's .git entity, bypassing the .git-as-a-directory check.
  • git~<digits> - NTFS 8.3 short-name aliases of .git. Only the literal git~1 was rejected; git~2, git~10, GIT~1, etc. were all accepted.

Contributing configuration bugs made matters worse. The core.protectNTFS and core.protectHFS settings were looked up under a wrong option name and so user-set values were silently ignored, and core.protectNTFS only defaulted to true on Windows (Git upstream has defaulted it to true everywhere since CVE-2019-1353). Both have been corrected.

Anyone who clones, fetches, or checks out an untrusted repository with Dulwich on Windows - either through the Dulwich CLI, porcelain.clone, or any downstream tool built on Dulwich - is impacted. POSIX clones are not directly exploitable (on POSIX \ is a literal filename byte), but a POSIX user can unknowingly propagate a malicious tree to Windows consumers via push or re-publication.

Patches

Fixed in Dulwich 1.2.5. Users should upgrade to 1.2.5 or later.

The fix lives in three commits:

  • Read core.protectNTFS / core.protectHFS under their documented option names so user-set values are honored.
  • Default core.protectNTFS to true on every platform, matching Git's PROTECT_NTFS_DEFAULT=1.
  • Reject \, :, and all git~<digits> 8.3 short-name forms in validate_path_element_ntfs.

Workarounds

There is no effective pre-patch workaround. On affected versions the core.protectNTFS configuration key was silently ignored, so setting it to true does not mitigate the issue. Users who cannot upgrade should avoid cloning, fetching, or checking out untrusted repositories with Dulwich on Windows. After upgrading the NTFS validator is on by default on every platform, so no additional configuration is required.

Resources

  • Git upstream path validation: https://github.com/git/git/blob/master/path.c (is_ntfs_dotgit, verify_path)
  • CVE-2019-1353 - the Git upstream vulnerability that established core.protectNTFS = true as the cross-platform default
  • CVE-2019-1354 - backslash-in-tree-path class in Git, analogous to this issue

Executive ViewAI

Why It Matters

Dulwich, a widely-used pure-Python Git implementation, contains a critical remote code execution vulnerability (CVSS 8.8) triggered by processing malicious Git repositories. Organizations using Dulwich face code execution risk when developers clone untrusted repositories or when CI/CD pipelines interact with external Git sources. This presents a significant supply chain threat that could compromise entire development environments.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Disable pre-commit and post-commit hook execution via Git core configuration settings; (2) Restrict Git clone operations to vetted internal repositories and enforce code review for all new repository additions; (3) Containerize or sandbox Dulwich operations with minimal system privileges and network access; (4) Implement filesystem monitoring for suspicious executable creation within .git/hooks directories; (5) Conduct mandatory security code review of any .git directory modifications or hooks.

Threat Intelligence Overview

EPSS Score
0.2%
Top 55% exploitable
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Affected Products (CPE)CVE.org

pkg:pip/dulwich

Vendor StatusVendor

SUSE

Product Status
openSUSE Tumbleweed Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy