{"id":"CVE-2026-24686","aliases":["CVE-2026-24686","GHSA-jqc5-w2xx-5vq4","GO-2026-4377"],"related":["CGA-hj3w-qhv4-jjc2"],"kind":"vulnerability","state":"published","title":"go-tuf Path Traversal in TAP 4 Multirepo Client Allows Arbitrary File Write via Malicious Repository Names","summary":"go-tuf is a Go implementation of The Update Framework (TUF). go-tuf's TAP 4 Multirepo Client uses the map file repository name string (`repoName`) as a filesystem path component when selecting the local metadata cache directory. Starting in version 2.0.0 and prior to version 2.4.1, if an application accepts a map file from an untrusted source, an attacker can supply a `repoName` containing traversal (e.g., `../escaped-repo`) and cause go-tuf to create directories and write the root metadata file outside the intended `LocalMetadataDir` cache base, within the running process's filesystem permissions. Version 2.4.1 contains a patch.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"go-tuf is a Go implementation of The Update Framework (TUF). go-tuf's TAP 4 Multirepo Client uses the map file repository name string (`repoName`) as a filesystem path component when selecting the local metadata cache directory. Starting in version 2.0.0 and prior to version 2.4.1, if an application accepts a map file from an untrusted source, an attacker can supply a `repoName` containing traversal (e.g., `../escaped-repo`) and cause go-tuf to create directories and write the root metadata file outside the intended `LocalMetadataDir` cache base, within the running process's filesystem permissions. Version 2.4.1 contains a patch.","source":"cvelist"},{"lang":"en","text":"# Security Vulnerability: Path Traversal in TAP 4 Multirepo Client\n\n## Summary\n\ngo-tuf's TAP 4 Multirepo Client uses the map file repository name string (`repoName`) as a filesystem path component when selecting the local metadata cache directory. If an application accepts a map file from an untrusted source, an attacker can supply a `repoName` containing traversal (e.g., `../escaped-repo`) and cause go-tuf to create directories and write the root metadata file outside the intended `LocalMetadataDir` cache base, within the running process's filesystem permissions.\n\n## Affected Component\n\n| Field | Value |\n|-------|-------|\n| **File** | `metadata/multirepo/multirepo.go` |\n| **Function** | `(*MultiRepoClient) initTUFClients() error` |\n| **Callsite** | `metadataDir := filepath.Join(client.Config.LocalMetadataDir, repoName)` (around line 129 at the pinned commit) |\n\n## Impact\n\nWhen the TAP 4 map file content is attacker-controlled, this enables arbitrary file write relative to the process permissions (via metadata persistence during client initialization). This can be used to overwrite files writable by the process (for example, configuration files in writable directories) and may enable further compromise depending on the deployment environment.\n\n> **Note:** Exploitability is deployment-dependent. If the map file is always local and trusted (not attacker-controlled), this reduces to a misconfiguration risk rather than a remotely triggerable issue.\n\n## Attacker Model\n\n- Attacker can cause the application to load a TAP 4 map file whose `repositories` keys are attacker-controlled (for example: fetched from a URL, supply-chain substituted, or otherwise attacker-influenced input).\n- Local caching is enabled (`DisableLocalCache=false`) and the configured `LocalMetadataDir` is writable by the running process.\n\n**Claim Ceiling:** HIGH when the map file is attacker-controlled; if the map file is always local and trusted, this is closer to a configuration footgun and likely lands as MEDIUM/LOW.\n\n| Field | Value |\n|-------|-------|\n| **Affected Versions** | ≤ 2.4.0 |\n| **Verified On** | Commit `bde5f18dc95dfac365fc452ee4e278e5fd66d4b4` (tag v2.4.0) |\n\n> **Note:** First affected version has not been bisected.\n\n## Reproduction\n\nAttachments include `poc.zip` with:\n- `canonical.log` (contains `[CALLSITE_HIT]`, `[PROOF_MARKER]`)\n- `control.log` (contains `[CALLSITE_HIT]`, `[NC_MARKER]`, does not contain `[PROOF_MARKER]`)\n- `fix.patch` (minimal validation sketch)\n\n**Expected:** Multirepo repository names are treated as identifiers; a TAP 4 map file containing traversal or absolute paths is rejected (or safely normalized so that all writes stay under `LocalMetadataDir`).\n\n**Actual:** A traversal `repoName` escapes `LocalMetadataDir` and go-tuf persists `root.json` under the escaped path during initialization.\n\n### Run Local Repro\n\n```bash\nrm -rf _poc\nmkdir -p _poc\nunzip -q -o poc.zip -d _poc\ncd _poc/poc\nmake canonical\nmake control\n```\n\n## Workarounds\n\n1. Treat TAP 4 map files as trusted configuration only (do not fetch from untrusted sources).\n2. Validate repo names before passing the map file to go-tuf (reject absolute paths, path separators, and traversal components like `.` / `..`).\n3. If acceptable for the application, disable local caching to avoid writing metadata to disk (`DisableLocalCache=true`).\n\n## Suggested Remediation\n\nValidate multirepo repository names as identifiers (not paths) before using them in `filepath.Join`. Reject:\n- Absolute paths\n- Path separators (`/` and `\\`)\n- Traversal components (`.` and `..`)\n\nIf it is important to accept a wider set of repo names, a safer alternative is to map repo names to a stable, validated directory name (for example via encoding or hashing) and to ensure all writes stay under the cache base directory.\n\n## Triage Questions\n\n1. Is the TAP 4 map file expected to ever be fetched from untrusted sources in supported deployments?\n2. Should invalid repo names be treated as a hard error (reject initialization), or as a soft error (skip that repository entry)?\n\n## Attachments\n\n- [poc.zip](https://github.com/user-attachments/files/24849854/poc.zip)\n- [addendum.md](https://github.com/user-attachments/files/24849855/addendum.md)\n- [e2e.zip](https://github.com/user-attachments/files/24849856/e2e.zip)\n- [PR_DESCRIPTION.md](https://github.com/user-attachments/files/24849858/PR_DESCRIPTION.md)\n\n---\n\n*Reported by: Oleh*","format":"markdown","source":"ghsa"},{"lang":"en","text":"Path traversal in TAP 4 multirepo client allows arbitrary file write via repo names in github.com/theupdateframework/go-tuf","format":"markdown","source":"go"},{"lang":"es","text":"go-tuf es una implementación en Go de The Update Framework (TUF). El cliente Multirepo TAP 4 de go-tuf utiliza la cadena del nombre del repositorio del archivo de mapa ('repoName') como un componente de ruta del sistema de archivos al seleccionar el directorio de caché de metadatos local. A partir de la versión 2.0.0 y antes de la versión 2.4.1, si una aplicación acepta un archivo de mapa de una fuente no confiable, un atacante puede proporcionar un 'repoName' que contenga recorrido (p. ej., '../escaped-repo') y hacer que go-tuf cree directorios y escriba el archivo de metadatos raíz fuera de la base de caché 'LocalMetadataDir' prevista, dentro de los permisos del sistema de archivos del proceso en ejecución. La versión 2.4.1 contiene un parche.","source":"nvd"}],"published":"2026-01-26T23:49:55.000Z","modified":"2026-09-10T03:50:33.249Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N","score":4.7,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N","score":4.7,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N","score":4.7,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N","score":4.7,"rating":"MEDIUM"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":">= 2.0.0, < 2.4.1","status":"affected"}],"vendor":"theupdateframework","product":"go-tuf","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.4.1"}],"ecosystem":"Go","package":"github.com/theupdateframework/go-tuf/v2","purl":"pkg:golang/github.com/theupdateframework/go-tuf/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.4.1"}],"ecosystem":"Go","package":"github.com/theupdateframework/go-tuf/v2","purl":"pkg:golang/github.com/theupdateframework/go-tuf/v2","source":"go"},{"ranges":[{"status":"affected","introduced":"2.0.0","fixed":"2.4.1"}],"vendor":"theupdateframework","product":"go-tuf","cpe":"cpe:2.3:a:theupdateframework:go-tuf:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/theupdateframework/go-tuf/security/advisories/GHSA-jqc5-w2xx-5vq4","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/theupdateframework/go-tuf/commit/d361e2ea24e427581343dee5c7a32b485d79fcc0","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-24686","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/theupdateframework/go-tuf","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-01-27T14:39:18.006Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-24686","url":"https://www.cve.org/CVERecord?id=CVE-2026-24686","licence":"CVE Terms of Use","modified":"2026-01-27T14:40:01.511Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-jqc5-w2xx-5vq4","url":"https://github.com/advisories/GHSA-jqc5-w2xx-5vq4","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:33.249Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4377","url":"https://pkg.go.dev/vuln/GO-2026-4377","licence":"CC-BY-4.0","modified":"2026-02-26T18:26:44.000Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-24686","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-24686","licence":"Public domain","modified":"2026-06-17T10:23:25.357Z"}],"updatedAt":"2026-11-25T22:59:13.206Z","epss":{"score":0.00231,"percentile":0.14965,"date":"2026-12-01T12:00:22.000Z"}}