# CVE-2026-47712: dulwich — Fixed in 1.2.5

🐍

🐍 PyPI

Not in CISA KEV

LOW severity

# CVE-2026-47712 — dulwich

LOW [Fix: jelmer/dulwich@c2446e5](https://github.com/jelmer/dulwich/commit/c2446e51b)

CVE-2026-47712 is a low-severity (CVSS 3.3) Path Traversal vulnerability in dulwich. A fix is available for dulwich — see the affected versions and patch details below.

Dulwich doesn't sanitize commit subjects in \`porcelain.format\_patch\`

Also known as[GHSA-555p-6grf-mh7f](/vulnerability/GHSA-555p-6grf-mh7f)PYSEC-2026-2462

Published

Jun 10, 2026

Updated

Oct 28, 2026

Affected

1 pkg

Patched

1 / 1

Exploits

None indexed

Exploitation data as of Dec 3, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

## Exploitation Status

### No confirmed exploitation observed yet

-   CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for CVE-2026-47712.

## EPSS Exploitation Probability

[via FIRST.org ↗](https://www.first.org/epss/)

0.1%probability of exploitation in next 30 days

Lower Risk0.00%

Lower risk than most CVEs3th percentile — riskier than 3% of all scored CVEsHighest risk

0.00%0.23%0.45%0.68%0.1%0.1%Jul 26Oct 26Dec 26

Probability of exploitation in the next 30 days, from [FIRST.org EPSS](https://www.first.org/epss/).

## How urgent is this, really

## Where this sits among everything scored

## Real-World Exposure

1 pkg affected

🐍`dulwich`

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

## Description

#### Impact

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. Reduced examples:

-   x/../../x produced <outdir>/0001-x/../../x.patch, resolving two directories above outdir.
-   x....\\x produced the equivalent escape on Windows, here \\ is also a path separator.

Related issues from the same root cause:

-   Subjects containing characters that are illegal in Windows filenames (e.g. :) caused format\_patch to fail outright on Windows, where git would have succeeded.
-   Very long subjects produced excessively long filenames that could exceed filesystem limits; git truncates them.

Anyone calling porcelain.format\_patch (or the dulwich format-patch CLI) against untrusted commits - for example, a service that runs format-patch over user-supplied repositories or pull requests - could have patch files written to attacker-chosen locations within the process's write permissions.

#### Patches

Fixed in Dulwich 1.2.5. Users should upgrade.

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.

#### Workarounds

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.
-   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.

#### Resources

-   Fix commit: [https://github.com/jelmer/dulwich/commit/c2446e51b](https://github.com/jelmer/dulwich/commit/c2446e51b)
-   Affected API: dulwich.porcelain.format\_patch / dulwich format-patch
-   Reference behavior: git's format\_sanitized\_subject in pretty.c

## Affected Packages

1 total 1 fixed

Ecosystem

Package

Vulnerable range

Fix

🐍PyPI

`dulwich` 

≥ 0.24.0&&< 1.2.5

1.2.5`pip install --upgrade 'dulwich==1.2.5'`

## Detection & mitigation playbook

Open-source dependency

1.  ### Detect
    
    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for dulwich, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
    
2.  ### Fix
    
    Update dulwich to 1.2.5 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-47712 is resolved across your whole dependency graph.
    
3.  ### Workarounds
    
    Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
    

## Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatLow

This Low impact path traversal vulnerability in Dulwich affects the format\_patch function when processing commit subjects. A malicious commit subject containing path separator characters could cause patch files to be written outside the intended output directory. Exploitation requires passing untrusted commit data to…

Workaround published by Red Hat

> Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.

Source: [Red Hat security advisory for CVE-2026-47712](https://access.redhat.com/security/cve/cve-2026-47712) (CC BY 4.0)

## Frequently Asked Questions

\### Impact 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. Reduced examples: - x/../../x produced <outdir>/0001-x/../../x.patch, resolving two directories a

O3 Security · Impact-Aware SCA

### Is CVE-2026-47712 in your dependencies?

Find it across PyPI, including transitive dependencies.

[Scan my dependencies](/book-demo) [How O3 SCA works](/impact-aware-sca)