FKIE_CVE-2026-47712
Vulnerability from fkie_nvd - Published: 2026-06-10 23:16 - Updated: 2026-07-21 19:10
Severity
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.
References
Impacted products
| Vendor | Product | Version |
|---|
{
"affected": [
{
"affectedData": [
{
"product": "dulwich",
"vendor": "jelmer",
"versions": [
{
"status": "affected",
"version": "\u003e= 0.24.0, \u003c 1.2.5"
}
]
}
],
"source": "security-advisories@github.com"
}
],
"cveTags": [],
"descriptions": [
{
"lang": "en",
"value": "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\u0027s 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\u0027s 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\u0027s first line contains /, \\, .., or other characters that are not safe on the target filesystem."
},
{
"lang": "es",
"value": "Dulwich es una implementaci\u00f3n puramente en Python de los formatos de archivo y protocolos de Git. A partir de la versi\u00f3n 0.24.0 y antes de la versi\u00f3n 1.2.5, dulwich.porcelain.format_patch(outdir=...) deriva cada nombre de archivo de parche de la l\u00ednea de asunto del commit. Antes de esta correcci\u00f3n, get_summary solo reemplazaba los espacios con guiones - los separadores de ruta (/, \\), los componentes de directorio padre (..), y otros caracteres hostiles para nombres de archivo (p. ej. :) se conservaban textualmente y se pasaban directamente a os.path.join(outdir, f\"{i:04d}-{summary}.patch\"). Un asunto de commit malicioso podr\u00eda, por lo tanto, dirigir el archivo de parche generado fuera del outdir solicitado. Esto se corrige en Dulwich 1.2.5. Los usuarios deber\u00edan actualizar a la versi\u00f3n 1.2.5 o posterior. dulwich.patch.get_summary ahora refleja el format_sanitized_subject de git: solo se mantienen \u0027[A-Za-z0-9._]\u0027, las secuencias de otros caracteres se colapsan a un solo -, los puntos consecutivos se colapsan a un solo ., los ./- finales se eliminan, y el resultado tiene una longitud limitada. Esto hace que la cadena devuelta sea segura para incrustar como un componente de nombre de archivo, por lo que format_patch ya no puede ser dirigido fuera de outdir a trav\u00e9s del asunto del commit. Hasta que se actualice, los llamadores que pasan commits no confiables a porcelain.format_patch pueden usar stdout=True y escribir el parche en un destino que controlen, en lugar de dejar que format_patch elija el nombre de archivo; validar la ruta elegida antes de abrir - p. ej. comparar os.path.realpath(returned_path) con os.path.realpath(outdir) y rechazar cualquier parche cuya ruta resuelta no est\u00e9 dentro de outdir; y/o pre-filtrar commits y negarse a formatear cualquiera cuya primera l\u00ednea del asunto contenga /, \\, .., u otros caracteres que no sean seguros en el sistema de archivos de destino."
}
],
"id": "CVE-2026-47712",
"lastModified": "2026-07-21T19:10:00.107",
"metrics": {
"cvssMetricV31": [
{
"cvssData": {
"attackComplexity": "LOW",
"attackVector": "LOCAL",
"availabilityImpact": "NONE",
"baseScore": 3.3,
"baseSeverity": "LOW",
"confidentialityImpact": "NONE",
"integrityImpact": "LOW",
"privilegesRequired": "NONE",
"scope": "UNCHANGED",
"userInteraction": "REQUIRED",
"vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N",
"version": "3.1"
},
"exploitabilityScore": 1.8,
"impactScore": 1.4,
"source": "security-advisories@github.com",
"type": "Secondary"
}
],
"ssvcV203": [
{
"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"ssvcData": {
"id": "CVE-2026-47712",
"options": [
{
"exploitation": "none"
},
{
"automatable": "no"
},
{
"technicalImpact": "partial"
}
],
"role": "CISA Coordinator",
"timestamp": "2026-06-11T12:41:02.775185Z",
"version": "2.0.3"
}
}
]
},
"published": "2026-06-10T23:16:48.650",
"references": [
{
"source": "security-advisories@github.com",
"url": "https://github.com/jelmer/dulwich/commit/c2446e51b"
},
{
"source": "security-advisories@github.com",
"url": "https://github.com/jelmer/dulwich/releases/tag/dulwich-1.2.5"
},
{
"source": "security-advisories@github.com",
"url": "https://github.com/jelmer/dulwich/security/advisories/GHSA-555p-6grf-mh7f"
}
],
"sourceIdentifier": "security-advisories@github.com",
"vulnStatus": "Deferred",
"weaknesses": [
{
"description": [
{
"lang": "en",
"value": "CWE-22"
}
],
"source": "security-advisories@github.com",
"type": "Secondary"
}
]
}
Loading…
Loading…
Experimental. This forecast is provided for visualization only and may change without notice. Do not use it for operational decisions.
Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
The MITRE ATT&CK techniques below are AI-generated suggestions, inferred from the description of the
vulnerability by the CIRCL/vulnerability-attack-technique-classification-roberta-base
model, served locally by ML-Gateway.
They have not been verified by an analyst and are provided for guidance only.
Loading…
Loading…