Read the docs
TI-2026-35213 Aliases CVE-2026-47712GHSA-555p-6grf-mh7f

Dulwich doesn't sanitize commit subjects in `porcelain.format_patch`

Priority LOW 15CWE-22Published · Updated

Key facts

Attack vector
Local
Privileges required
None
User interaction
Required
Attack complexity
Low
Impact type
—
Confidentiality · integrity · availability
None · Low · None
Fix status
Partial Red Hat: 6 without a fix

Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat.

Summary

Dulwich is a pure-Python implementation of the Git file formats and protocols. Starting in version 0.24.0 and prior to version 1.2.5, dulwich.porcelain.format_patch(outdir=...) derives each patch filename from the commit's subject line. Prior to this fix, get_summary only replaced spaces with dashes - path separators (/, \), parent-directory components (..), and other filename-hostile characters (e.g. :) were preserved verbatim and passed straight into os.path.join(outdir, f"{i:04d}-{summary}.patch"). A malicious commit subject could therefore direct the generated patch file outside the requested outdir. This is fixed in Dulwich 1.2.5. Users should upgrade to 1.2.5 or later. dulwich.patch.get_summary now mirrors git's format_sanitized_subject: only `[A-Za-z0-9._]` are kept, runs of other characters collapse to a single -, consecutive . collapse to a single ., trailing ./- are stripped, and the result is length-limited. This makes the returned string safe to embed as a filename component, so format_patch can no longer be steered out of outdir via the commit subject. Until upgrading, callers that pass untrusted commits to porcelain.format_patch can use stdout=True and write the patch to a destination they 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; and/or 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.

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.00139 3rd percentileScored 2026-11-07
Fix Partial dulwich (jelmer): 1.2.5dulwich (PyPI): 1.2.5Red Hat: 6 without a fix

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
None
Automatable
No
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
jelmerdulwich0.24.0 to before 1.2.51.2.5Patch availableCNA
—dulwich (PyPI)0.24.0 to before 1.2.51.2.5Patch availableGHSA-555p-6grf-mh7f
  • dulwich Vendorjelmer Affected 0.24.0 to before 1.2.5 Fixed in 1.2.5 Patch available CNA
  • dulwich (PyPI) Vendor— Affected 0.24.0 to before 1.2.5 Fixed in 1.2.5 Patch available GHSA-555p-6grf-mh7f

Remediation

  • Fix · CNA dulwich (jelmer) Fixed in 1.2.5
  • Fix · GHSA-555p-6grf-mh7f dulwich (PyPI) Fixed in 1.2.5 Advisory →

Vendor assessments

Red Hat

Red Hat rating: Low. Red Hat's page for this CVE →

ProductStatusPlan or fix
Red Hat Ansible Automation Platform 2AffectedNo fix yet: Fix deferred
Red Hat Enterprise Linux 7AffectedNo fix yet: Fix deferred
Red Hat Enterprise Linux 8AffectedNo fix yet: Fix deferred
Red Hat OpenShift AI (RHOAI)AffectedNo fix yet: Fix deferred
Red Hat OpenShift Container Platform 4AffectedNo fix yet: Fix deferred
Red Hat Satellite 6AffectedNo fix yet: Fix deferred

Timeline

  1. 2026-10-02 Threatist record created from CVE-2026-47712
  2. 2026-10-03 Alias added: GHSA-555p-6grf-mh7f

References

  • TI-2026-78707 Path traversal in Dulwich lets attackers write files on Windows CVSS 4.0HIGH 8.7
  • TI-2026-37846 Path traversal in jelmer dulwich CVSS 3.1HIGH 7.5
  • TI-2026-30843 Dulwich Vulnerable to Command Injection via Merge Driver Path CVSS 4.0HIGH 7.7
  • TI-2026-78709 Symlink following in Dulwich checkout allows arbitrary file writes CVSS 4.0HIGH 7.3
  • TI-2026-30613 Dulwich has an arbitrary file write via NTFS-hostile tree entries on Windows CVSS 3.1HIGH 8.8
  • TI-2026-85266 Dulwich commit parser picks the wrong tree from duplicate headers CVSS 4.0HIGH 8.6
See all 10 →

Sources