-
Notifications
You must be signed in to change notification settings - Fork 110
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
fix(verify): Fix a vulnerability in the verification of threshold signatures (due to handling of keys with multiple IDs) #369
Conversation
I realise I should probably have shared this privately with the maintainers instead of sending a public PR, apologies. |
Thanks for reporting this. I had found a similar issue for python-tuf before, but unfortunately we never got around to publishing it, which may explain why no other implementations had noticed. It looks good on a cursory glance, but let us review and merge ASAP. |
I'll do a more detailed review, but it looks like this needs DCO and conventional commits
Yes, for future reference, but thanks for sharing this. We'll work to improve our security reporting docs to make the private reporting process more clear in the future. |
LGTM. I'll approve pending the failing checks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @cedricvanrompay-datadog, @ethan-lowman-dd, and I discussed this over Zoom, thanks!
…natures (due to handling of keys with multiple IDs) (theupdateframework#369) * add test for several signatures same key diff ID * fix verifying threshold signatures * add some comments * rename variables and add comments Co-authored-by: Trishank Karthik Kuppusamy <[email protected]>
…natures (due to handling of keys with multiple IDs) (theupdateframework#369) * add test for several signatures same key diff ID * fix verifying threshold signatures * add some comments * rename variables and add comments Co-authored-by: Trishank Karthik Kuppusamy <[email protected]> Signed-off-by: Zachary Newman <[email protected]>
…eshold si… (#375) fix(verify): Fix a vulnerability in the verification of threshold signatures (due to handling of keys with multiple IDs) (#369) * add test for several signatures same key diff ID * fix verifying threshold signatures * add some comments * rename variables and add comments Co-authored-by: Trishank Karthik Kuppusamy <[email protected]> Signed-off-by: Zachary Newman <[email protected]> Signed-off-by: Zachary Newman <[email protected]> Co-authored-by: Cédric Van Rompay <[email protected]> Co-authored-by: Trishank Karthik Kuppusamy <[email protected]>
…natures (due to handling of keys with multiple IDs) (theupdateframework#369) * add test for several signatures same key diff ID * fix verifying threshold signatures * add some comments * rename variables and add comments Co-authored-by: Trishank Karthik Kuppusamy <[email protected]>
Release Notes: Fixes a vulnerability in the verification of threshold signatures (due to handling of keys with multiple IDs)
Types of changes:
Description of the changes being introduced by the pull request:
Go-TUF has a security vulnerability in the way it validates threshold signatures: it relies on the key IDs declared in the metadata file it is currently validating (varibale
sig.KeyID
) to tell if this new signature should count towards the threshold, assuming that these IDs will be the same as the one it generates (verifier.MarshalPublicKey().IDs()
). This assumption can be made false and this can be leveraged to forge valid threshold signatures using a number of keys which, in theory, should be insufficient.This PR adds a test demonstrating the vulnerability, then it fixes the vulnerability.
My opinion however is that Go-TUF should stop trying to be compatible with old versions of TUF implementations that were assigning several IDs to a same key, as this makes signature validation way too error-prone. Note that all versions of the TUF specification since version 1 are very clear on there being a single correct way to compute the key ID:
Also, I am aware that TAP 12 (which does not apply to TUF 1.0.x anyway) introduces key ID flexibility. A better solution than the one in this PR would be to apply the recommendation in TAP 12 to "use a standardized representation for keys, like the modulus and exponent for RSA or the point and curve for ECC". That's probably something we should do in Go-TUF without waiting for TUF 1.1.
Please verify and check that the pull request fulfills the following requirements: