CVE-2026-42305
Dulwich has an arbitrary file write via NTFS-hostile tree entries on Windows
Also known as GHSA-897w-fcg9-f6xj, PYSEC-2026-2463
Mitigation
- Upgrade dulwich to 1.2.5 or later.
Who should check
- Projects that depend on PyPI package dulwich (>= 0.10.0, < 1.2.5)
- Anyone running jelmer dulwich >= 0.10.0, < 1.2.5
Vulnerability facts
- Affected
- dulwich >= 0.10.0, < 1.2.5
- Fixed in
- 1.2.5
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 8.8 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: None
- User interaction: Required
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- EPSS
- 0.85% chance of exploitation in 30 days (percentile 56, 2026-11-26)
- CWE
- CWE-22
- Modified
Description
Dulwich is a pure-Python implementation of the Git file formats and protocols. Versions starting with 0.10.0 and prior to 1.2.5 have an 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. 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. This issue is fixed in Dulwich 1.2.5. Users should upgrade to 1.2.5 or later. 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.
Affected and fixed versions
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2026-42305. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2026-42305.md Affected: dulwich >= 0.10.0, < 1.2.5 Fixed in: 1.2.5 Steps: 1. Search this machine and project for dulwich (PyPI), jelmer dulwich: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Patches
FAQ
Is CVE-2026-42305 being exploited?
There is no confirmed exploitation: CVE-2026-42305 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.85% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2026-42305?
High: CVSS 8.8 (v3.1, scored by CNA). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work.
Which versions are affected by CVE-2026-42305?
dulwich >= 0.10.0, < 1.2.5.
Is there a fix for CVE-2026-42305?
Yes. Fixed in 1.2.5. Upgrade dulwich to 1.2.5 or later.
How do I check if I'm affected by CVE-2026-42305?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.