github.com/theupdateframework/go-tuf
Affected
- introduced
0, fixed0.3.2(semver)
Fixed versions
0.3.2
Fix
- Fixed version
0.3.2go get github.com/theupdateframework/[email protected]
Advisory
Also known as: GO-2022-1004
Go-tuf Improperly handles multiple key IDs for the same public keys in attacker-controlled metadata
Issue
If an attacker is able to control a threshold of keys to insert the same public key more than once with different key IDs into signed, trusted metadata on a TUF repository, then go-tuf clients < 0.3.2 are susceptible to an attack where attackers can cause the same signature from the same public key to be counted more than once against the threshold of signatures because they were mistakenly distinguished due to having different key IDs.
For example, suppose that in the root metadata file, there were a threshold of 2 self-signatures required from 2 different keys $K_A$ and $K_B$ belonging to Alice and Bob respectively. Bob has either mistakenly or maliciously produced a signed a malicious version of the root metadata file where Alice's key is listed once with the keyid $SHA2_{256}(K_A)$, but his public key is listed twice, once with the keyid $SHA2_{256}(K_B)$, and the other with $SHA2_{512}(K_B)$. If Bob can convince Alice to mistakenly sign this root metadata file without noticing this error, then clients < 0.3.2 would mistakenly count the same signature from Bob twice, once with the keyid $SHA2_{256}(K_B)$, and the other with $SHA2_{512}(K_B)$.
Impact
While the impact is potentially high, the severity is low as it requires either attackers or the repository (deliberately or mistakenly respectively) to have produced such an incorrect distribution of public keys, causing clients < 0.3.2 to fall prey to this issue.
Patches
A fix is available for clients with versions >= 0.3.2.
Workarounds
Users can work around this vulnerability in previous clients by checking for and removing _duplicate_ public keys with different key IDs (e.g., SHA2-256 and SHA2-512 hashes of the same public key) in all signed metadata on their TUF repositories.
References
keyid_hash_algorithms field in TUF metadata which arguably led to this issue.For more information
If you have any questions or comments about this advisory:
Low Basis: The source's own band: LOW
0, fixed 0.3.2 (semver)0.3.2
0.3.2go get github.com/theupdateframework/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0