{"answers":{"affected":"3 open source packages ship an affected version, including dulwich.","exploited":"There is no known exploitation of CVE-2026-47712 in the wild and no public exploit code.","fix":"Upgrade dulwich to 1.2.5 or later.","what":"CVE-2026-47712 is a low-severity path traversal vulnerability in jelmer dulwich, published on 10 Jun 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2026-47712 and fix it if it is affected.\n\nWhat it is: CVE-2026-47712 is a low-severity path traversal vulnerability in jelmer dulwich, published on 10 Jun 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2026-47712 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- dulwich (PyPI): affected from 0.24.0; fixed in 1.2.5\n- dulwich (PyPI): affected from 0.24.0; fixed in 1.2.5\n- dulwich (PyPI): affected from 0.24.0; fixed in 1.2.5\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-47712/ (Markdown: https://insights.sbomify.com/CVE-2026-47712/index.md)","id":"CVE-2026-47712","markdown":"https://insights.sbomify.com/CVE-2026-47712/index.md","name":"CVE-2026-47712","record":{"aliases":["CLEANSTART-2026-UA20126","CLSA-2026-1784164011","DEBIAN-CVE-2026-47712","ECHO-5850-4d68-024e","GHSA-555p-6grf-mh7f","MINI-x6q7-pwp4-w446","PYSEC-2026-2462","UBUNTU-CVE-2026-47712"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_modify"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Python Git library","requires_auth":"none","summary":"Attackers can write patch files outside the intended directory via malicious commit subjects in Dulwich's format_patch function.","user_interaction":"required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":3.3,"severity":"low","source":"cna","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N","version":"3.1"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"description":"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.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Dulwich doesn't sanitize commit subjects in `porcelain.format_patch`","id":"CVE-2026-47712","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"path_traversal","year":"2026"},"n_packages":3,"n_references":3,"next":{"headline":"AnythingLLM: Legacy mobile device tokens bypass multi-user workspace scoping after mode migration","id":"CVE-2026-47713"},"packages":[{"ecosystem":"PyPI","fixed":["1.2.5"],"introduced":["0.24.0"],"last_affected":[],"package":"dulwich","purl":null,"source":"GHSA-555p-6grf-mh7f"},{"ecosystem":"PyPI","fixed":["1.2.5"],"introduced":["0.24.0"],"last_affected":[],"package":"dulwich","purl":"pkg:pypi/dulwich","source":"GHSA-555p-6grf-mh7f"},{"ecosystem":"PyPI","fixed":["1.2.5"],"introduced":["0.24.0"],"last_affected":[],"package":"dulwich","purl":"pkg:pypi/dulwich","source":"PYSEC-2026-2462"}],"prev":{"headline":"libheif has a NULL pointer dereference in heif_image_handle_get_image_tiling for malformed unci image missing ispe","id":"CVE-2026-47709"},"products":["dulwich"],"published":"2026-06-10","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2026-06-11","vendors":["jelmer"]},"summary":"Attackers can write patch files outside the intended directory via malicious commit subjects in Dulwich's format_patch function.","url":"https://insights.sbomify.com/CVE-2026-47712/"}