Skip to content

Commit 3edfbeb

Browse files
update(deps): update module github.com/theupdateframework/go-tuf/v2 to v2.4.1 [security] (#164)
This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [github.com/theupdateframework/go-tuf/v2](https://redirect.github.com/theupdateframework/go-tuf) | `v2.3.1` -> `v2.4.1` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2ftheupdateframework%2fgo-tuf%2fv2/v2.4.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2ftheupdateframework%2fgo-tuf%2fv2/v2.3.1/v2.4.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | ### GitHub Vulnerability Alerts #### [CVE-2026-24686](https://redirect.github.com/theupdateframework/go-tuf/security/advisories/GHSA-jqc5-w2xx-5vq4) # Security Vulnerability: Path Traversal in TAP 4 Multirepo Client ## Summary 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. 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. ## Affected Component | Field | Value | |-------|-------| | **File** | `metadata/multirepo/multirepo.go` | | **Function** | `(*MultiRepoClient) initTUFClients() error` | | **Callsite** | `metadataDir := filepath.Join(client.Config.LocalMetadataDir, repoName)` (around line 129 at the pinned commit) | ## Impact When 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. > **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. ## Attacker Model - 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). - Local caching is enabled (`DisableLocalCache=false`) and the configured `LocalMetadataDir` is writable by the running process. **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. | Field | Value | |-------|-------| | **Affected Versions** | ≤ 2.4.0 | | **Verified On** | Commit `bde5f18dc95dfac365fc452ee4e278e5fd66d4b4` (tag v2.4.0) | > **Note:** First affected version has not been bisected. ## Reproduction Attachments include `poc.zip` with: - `canonical.log` (contains `[CALLSITE_HIT]`, `[PROOF_MARKER]`) - `control.log` (contains `[CALLSITE_HIT]`, `[NC_MARKER]`, does not contain `[PROOF_MARKER]`) - `fix.patch` (minimal validation sketch) **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`). **Actual:** A traversal `repoName` escapes `LocalMetadataDir` and go-tuf persists `root.json` under the escaped path during initialization. ### Run Local Repro ```bash rm -rf _poc mkdir -p _poc unzip -q -o poc.zip -d _poc cd _poc/poc make canonical make control ``` ## Workarounds 1. Treat TAP 4 map files as trusted configuration only (do not fetch from untrusted sources). 2. Validate repo names before passing the map file to go-tuf (reject absolute paths, path separators, and traversal components like `.` / `..`). 3. If acceptable for the application, disable local caching to avoid writing metadata to disk (`DisableLocalCache=true`). ## Suggested Remediation Validate multirepo repository names as identifiers (not paths) before using them in `filepath.Join`. Reject: - Absolute paths - Path separators (`/` and `\`) - Traversal components (`.` and `..`) If 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. ## Triage Questions 1. Is the TAP 4 map file expected to ever be fetched from untrusted sources in supported deployments? 2. Should invalid repo names be treated as a hard error (reject initialization), or as a soft error (skip that repository entry)? ## Attachments - [poc.zip](https://redirect.github.com/user-attachments/files/24849854/poc.zip) - [addendum.md](https://redirect.github.com/user-attachments/files/24849855/addendum.md) - [e2e.zip](https://redirect.github.com/user-attachments/files/24849856/e2e.zip) - [PR_DESCRIPTION.md](https://redirect.github.com/user-attachments/files/24849858/PR_DESCRIPTION.md) --- *Reported by: Oleh* --- ### Release Notes <details> <summary>theupdateframework/go-tuf (github.com/theupdateframework/go-tuf/v2)</summary> ### [`v2.4.1`](https://redirect.github.com/theupdateframework/go-tuf/releases/tag/v2.4.1) [Compare Source](https://redirect.github.com/theupdateframework/go-tuf/compare/v2.4.0...v2.4.1) #### What's Changed - chore(deps): bump github.com/sigstore/sigstore from 1.10.3 to 1.10.4 by [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in [#&#8203;718](https://redirect.github.com/theupdateframework/go-tuf/pull/718) - Enforce a stricter validation on the repo name for TAP 4 by [@&#8203;rdimitrov](https://redirect.github.com/rdimitrov) in [#&#8203;720](https://redirect.github.com/theupdateframework/go-tuf/pull/720) **Full Changelog**: <theupdateframework/go-tuf@v2.4.0...v2.4.1> ### [`v2.4.0`](https://redirect.github.com/theupdateframework/go-tuf/releases/tag/v2.4.0) [Compare Source](https://redirect.github.com/theupdateframework/go-tuf/compare/v2.3.1...v2.4.0) #### What's Changed - Add BitLength validation for SuccinctRoles by [@&#8203;rdimitrov](https://redirect.github.com/rdimitrov) in [#&#8203;716](https://redirect.github.com/theupdateframework/go-tuf/pull/716) - Add thread safety documentation for key types by [@&#8203;rdimitrov](https://redirect.github.com/rdimitrov) in [#&#8203;715](https://redirect.github.com/theupdateframework/go-tuf/pull/715) - Use restrictive permissions (0700) for cache directories by [@&#8203;rdimitrov](https://redirect.github.com/rdimitrov) in [#&#8203;714](https://redirect.github.com/theupdateframework/go-tuf/pull/714) - Breaking change: Replace panic with error return in Key.ID() by [@&#8203;rdimitrov](https://redirect.github.com/rdimitrov) in [#&#8203;713](https://redirect.github.com/theupdateframework/go-tuf/pull/713) **Full Changelog**: <theupdateframework/go-tuf@v2.3.1...v2.4.0> </details> --- ### Configuration 📅 **Schedule**: Branch creation - "" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://redirect.github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNjUuNCIsInVwZGF0ZWRJblZlciI6IjQxLjE2NS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
1 parent 240ca49 commit 3edfbeb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ require (
443443
github.com/subosito/gotenv v1.6.0 // indirect
444444
github.com/tetafro/godot v1.5.4 // indirect
445445
github.com/theupdateframework/go-tuf v0.7.0 // indirect
446-
github.com/theupdateframework/go-tuf/v2 v2.3.1 // indirect
446+
github.com/theupdateframework/go-tuf/v2 v2.4.1 // indirect
447447
github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 // indirect
448448
github.com/timonwong/loggercheck v0.11.0 // indirect
449449
github.com/tomarrell/wrapcheck/v2 v2.12.0 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,8 +1211,8 @@ github.com/tetafro/godot v1.5.4 h1:u1ww+gqpRLiIA16yF2PV1CV1n/X3zhyezbNXC3E14Sg=
12111211
github.com/tetafro/godot v1.5.4/go.mod h1:eOkMrVQurDui411nBY2FA05EYH01r14LuWY/NrVDVcU=
12121212
github.com/theupdateframework/go-tuf v0.7.0 h1:CqbQFrWo1ae3/I0UCblSbczevCCbS31Qvs5LdxRWqRI=
12131213
github.com/theupdateframework/go-tuf v0.7.0/go.mod h1:uEB7WSY+7ZIugK6R1hiBMBjQftaFzn7ZCDJcp1tCUug=
1214-
github.com/theupdateframework/go-tuf/v2 v2.3.1 h1:fReZUTLvPdqIL8Rd9xEKPmaxig8GIXe0kS4RSEaRfaM=
1215-
github.com/theupdateframework/go-tuf/v2 v2.3.1/go.mod h1:9S0Srkf3c13FelsOyt5OyG3ZZDq9OJDA4IILavrt72Y=
1214+
github.com/theupdateframework/go-tuf/v2 v2.4.1 h1:K6ewW064rKZCPkRo1W/CTbTtm/+IB4+coG1iNURAGCw=
1215+
github.com/theupdateframework/go-tuf/v2 v2.4.1/go.mod h1:Nex2enPVYDFCklrnbTzl3OVwD7fgIAj0J5++z/rvCj8=
12161216
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
12171217
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
12181218
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=

0 commit comments

Comments
 (0)