PatchSiren cyber security CVE debrief
CVE-2026-47712 jelmer CVE debrief
CVE-2026-47712 is a security vulnerability in Dulwich, a pure-Python implementation of Git file formats and protocols. The vulnerability exists in the `dulwich.porcelain.format_patch` function, which derives patch filenames from commit subject lines. An attacker can exploit this vulnerability by crafting a malicious commit subject that directs the generated patch file outside the requested output directory. This vulnerability has a CVSS score of 3.3 and is considered low severity.
- Vendor
- jelmer
- Product
- dulwich
- CVSS
- LOW 3.3
- CISA KEV
- Not listed in stored evidence
- Original CVE published
- 2026-06-10
- Original CVE updated
- 2026-07-21
- Advisory published
- 2026-06-10
- Advisory updated
- 2026-07-21
Who should care
Users of Dulwich, a pure-Python implementation of Git file formats and protocols, should be aware of this vulnerability. Specifically, those who use Dulwich to format patches from untrusted commits should take precautions.
Technical summary
The `dulwich.porcelain.format_patch` function is vulnerable to a path traversal attack. An attacker can craft a malicious commit subject that directs the generated patch file outside the requested output directory. This is because the function uses the commit subject line to derive the patch filename, without properly sanitizing the input.
Defensive priority
Medium
Recommended defensive actions
- Upgrade to Dulwich 1.2.5 or later.
- Use `stdout=True` and write the patch to a destination you control, rather than letting `format_patch` choose the filename.
- Validate the chosen path before opening - e.g., compare `os.path.realpath(returned_path)` against `os.path.realpath(outdir)` and reject any patch whose resolved path is not inside `outdir`.
- Pre-screen commits and refuse to format any whose subject's first line contains /, , .., or other characters that are not safe on the target filesystem.
Evidence notes
The vulnerability is fixed in Dulwich 1.2.5. The `dulwich.patch.get_summary` function now mirrors Git's `format_sanitized_subject`, which sanitizes the commit subject line to make it safe to use as a filename component.
Sources and references
Verified primary and authoritative sources
-
CVE-2026-47712 CVE Program record
Publisher, destination, and source semantics verified
URL: https://www.cve.org/CVERecord?id=CVE-2026-47712
CVE Program - Official CVE Program record with source-provided CVE metadata.
-
CVE-2026-47712 NVD vulnerability detail
Publisher, destination, and source semantics verified
URL: https://nvd.nist.gov/vuln/detail/CVE-2026-47712
NIST National Vulnerability Database - Official NIST NVD detail page and source-specific vulnerability assessment.
Supplemental references
-
Source reference
Unverified legacy reference
URL: https://github.com/jelmer/dulwich/commit/c2446e51b
-
Source reference
Unverified legacy reference
URL: https://github.com/jelmer/dulwich/releases/tag/dulwich-1.2.5
-
Source reference
Unverified legacy reference
URL: https://github.com/jelmer/dulwich/security/advisories/GHSA-555p-6grf-mh7f
Methodology and review provenance
AI-assisted synthesis based on stored public vulnerability evidence. System validation, approval state, and publication status do not by themselves establish human review of this revision. PatchSiren helps prioritize defensive review and does not prove exposure or remediation on any system.