# CVE-2026-47712: Dulwich path traversal in porcelain.format_patch via commit subject

Source: https://junglewise.ai/threats/cve-2026-47712-dulwich-path-traversal-in-porcelain-format-patch-via-commit  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-10. Updated: 2026-06-10  
License: CC BY 4.0 with a link back

CVE-2026-47712 · Severity: low · CVSS 3.3 · Published 2026-06-10

Dulwich is a Python library used to interact with Git repositories. A security flaw in the way it generates patch files allows a specially crafted Git commit to save files outside of the intended folder. This could allow an attacker to overwrite or create files in unexpected locations on a user's system if they process a malicious repository.

Technologies: [dulwich (PyPI)](https://junglewise.ai/threats/technologies/dulwich). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-47712 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-47712 being exploited in the wild.

**How severe is CVE-2026-47712?** Low severity, with a CVSS score of 3.3, published 10 June 2026.

**Which products and versions are affected?** dulwich (PyPI) >= 0.24.0, < 1.2.5, ECOSYSTEM:introduced=0.24.0,fixed=1.2.5.

**Is there a fix for CVE-2026-47712?** Yes. dulwich (PyPI): upgrade to 1.2.5 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-47712 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2026-47712?** Check whether you run dulwich (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- dulwich (PyPI): upgrade to 1.2.5 or later

  ```sh
  pip install "dulwich>=1.2.5"
  ```


## Technical details

A path traversal vulnerability exists in `dulwich.porcelain.format_patch` due to insufficient sanitization in the `get_summary` function. The function derives patch filenames from commit subject lines but fails to strip path separators (/, \), parent-directory components (..), or other hostile characters. An attacker can craft a commit with a malicious subject line to write patch files to arbitrary locations outside the specified output directory. This is exploitable when a user or service processes untrusted commits using the affected API. The issue is fixed in version 1.2.5 by implementing sanitization that mirrors Git's native behavior.

## Affected products

- Jelmer Vernooĳ Dulwich >=0.24.0, <1.2.5

## Identifiers

- CVE-2026-47712
- GHSA-555p-6grf-mh7f
- PYSEC-2026-2462

## Timeline

- 2026-05-19: patched: Fix commit c2446e51b authored
- 2026-05-28: advisory: GitHub Security Advisory published
- 2026-06-10: disclosed: CVE-2026-47712 published to NVD

## References

- [https://github.com/jelmer/dulwich/commit/c2446e51b](https://github.com/jelmer/dulwich/commit/c2446e51b)
- [https://github.com/jelmer/dulwich/releases/tag/dulwich-1.2.5](https://github.com/jelmer/dulwich/releases/tag/dulwich-1.2.5)
- [https://github.com/jelmer/dulwich/security/advisories/GHSA-555p-6grf-mh7f](https://github.com/jelmer/dulwich/security/advisories/GHSA-555p-6grf-mh7f)

## Related threats

- [Dulwich arbitrary file write on Windows via unvalidated drive letters](https://junglewise.ai/threats/dulwich-arbitrary-file-write-rce-on-windows-via-unvalidated-drive-fc90311d)
- [Dulwich infinite loop denial of service in packfile object resolution](https://junglewise.ai/threats/dulwich-infinite-loop-denial-of-service-dos-in-packfile-object-d71acec7)
- [Dulwich symlink write-through in checkout via os.open](https://junglewise.ai/threats/dulwich-symlink-write-through-in-checkout-paths-via-raw-os-open-7e9ebad6)
- [Dulwich symlink directory traversal in filter-branch index_filter](https://junglewise.ai/threats/dulwich-symlink-directory-traversal-in-filter-branch-index-filter-via-c34daf58)
- [Dulwich symlink directory traversal in stash pop](https://junglewise.ai/threats/dulwich-symlink-directory-traversal-in-stash-pop-allows-arbitrary-file-12378d39)
