Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/vulndb: potential Go vuln in github.com/theupdateframework/go-tuf: GHSA-3633-5h82-39pq #1004

Closed
GoVulnBot opened this issue Sep 16, 2022 · 1 comment
Assignees

Comments

@GoVulnBot
Copy link

In GitHub Security Advisory GHSA-3633-5h82-39pq, there is a vulnerability in the following Go packages or modules:

Unit Fixed Vulnerable Ranges
github.com/theupdateframework/go-tuf 0.3.2 < 0.3.2

See doc/triage.md for instructions on how to triage this report.

modules:
  - module: TODO
    versions:
      - fixed: 0.3.2
    packages:
      - package: github.com/theupdateframework/go-tuf
description: |-
    ### 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](https://github.com/theupdateframework/go-tuf#client) < [0.3.2](https://github.com/theupdateframework/go-tuf/releases/tag/v0.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](https://github.com/theupdateframework/go-tuf/releases/tag/v0.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

    * The PR fixing this issue is #369.
    * The [latest](https://theupdateframework.github.io/specification/v1.0.30/index.html#role-keyid) TUF specification advises using only SHA2-256 hashes of public keys.
    * Commit b383bafd27472310a650f3733e686163a868b71a removed support for clients generating multiple key IDs for the same public key. This commit is older than the first [v.0.1.0 tag](https://github.com/theupdateframework/go-tuf/releases/tag/v0.1.0) for go-tuf.
    * There is an outstanding [issue](https://github.com/theupdateframework/go-tuf/issues/368) for removing the non-standard `keyid_hash_algorithms` field in TUF metadata which arguably led to this issue.
    * A more robust solution is discussed (but not necessarily recommended) in [TAP 12](https://github.com/theupdateframework/taps/blob/master/tap12.md), which suggests deduplicating public keys even more strongly on the basis of the fundamental parameters (e.g., exponents) to the cryptosystem rather than specific encodings (e.g., PEM) of public keys.

    ### For more information

    If you have any questions or comments about this advisory:
    * Open an issue in [go-tuf](https://github.com/theupdateframework/go-tuf/issues)
    * Email us at TUF's [mailing list](mailto:theupdateframework@googlegroups.com)
    * The [#tuf](https://cloud-native.slack.com/archives/C8NMD3QJ3) channel on [CNCF Slack](https://slack.cncf.io/).
ghsas:
  - GHSA-3633-5h82-39pq

@neild neild self-assigned this Sep 20, 2022
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/432161 mentions this issue: data/reports: add GO-2022-1004.yaml for GHSA-3633-5h82-39pq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants