CVE-2026-47712 is a low-severity path traversal vulnerability in dulwich (pip), affecting versions >= 0.24.0, < 1.2.5. It is fixed in 1.2.5.
Impact dulwich.porcelain.formatpatch(outdir=...) derives each patch filename from the commit's subject line. Prior to this fix, getsummary 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 formatpatch 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.formatpatch (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.getsummary now mirrors git's formatsanitizedsubject: 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 formatpatch can no longer be steered out of outdir via the commit subject. Workarounds Until upgrading, callers that pass untrusted commits to porcelain.formatpatch can: Use stdout=True and write the patch to a destination they control, rather than letting formatpatch choose the filename. Validate the chosen path before opening - e.g. compare os.path.realpath(returnedpath) 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 Affected API: dulwich.porcelain.formatpatch / dulwich format-patch Reference behavior: git's formatsanitized_subject in pretty.c
Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files. Typical impact: unauthorized file read or write outside the intended directory.
CVE-2026-47712 has a CVSS score of 3.3 (Low). The vector is requires local access, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.
A fixed version is available (1.2.5). Upgrading removes the vulnerable code path.
pip
dulwich (>= 0.24.0, < 1.2.5)dulwich → 1.2.5 (pip)Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.
Kodem's runtime-powered SCA identifies whether CVE-2026-47712 is reachable in your applications. Explore open-source security for your team.
See if CVE-2026-47712 is reachable in your applications. Get a demo
Already deployed Kodem? See CVE-2026-47712 in your environment →Upgrade dulwich to 1.2.5 or later to resolve this vulnerability.
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
CVE-2026-47712 is a low-severity path traversal vulnerability in dulwich (pip), affecting versions >= 0.24.0, < 1.2.5. It is fixed in 1.2.5. Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files.
CVE-2026-47712 has a CVSS score of 3.3 (Low). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
dulwich (pip) versions >= 0.24.0, < 1.2.5 is affected.
Yes. CVE-2026-47712 is fixed in 1.2.5. Upgrade to this version or later.
Whether CVE-2026-47712 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
Upgrade dulwich to 1.2.5 or later.