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

Rust verification library: fix comparison of different length signatures #1190

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

tasn
Copy link
Member

@tasn tasn commented Feb 6, 2024

There was a bug in the code which meant that the signatures are only compared up to the length of the shorter signature, which means that an attacker can just pass v1, as the signature and that will always pass verification.

This change fixes it so that the length of the signature is also taken into account when comparing, to make sure that it's always the same length before comparing.

Manually verified all of the other libraries are correct, and added tests to JavaScript and Go (even though they were also not affected).

Many thanks to Fredrik Meringdal (@fmeringdal) for the report.

There was a bug in the code which meant that the signatures are only
compared up to the length of the shorter signature, which means that an
attacker can just pass `v1,` as the signature and that will always pass
verification.

This change fixes it so that the length of the signature is also taken
into account when comparing, to make sure that it's always the same
length before comparing.

Manually verified all of the other libraries are correct, and added
tests to JavaScript and Go (even though they were also not affected).

Many thanks to Fredrik Meringdal (@fmeringdal) for the report.
@tasn tasn merged commit 958821b into main Feb 6, 2024
5 checks passed
@tasn tasn deleted the tom/fix-rust-verify branch February 6, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants