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

Fix vulnerability when processing bls sig transactions #287

Merged
merged 1 commit into from
Jan 19, 2023

Conversation

KonradStaniec
Copy link
Collaborator

Fixes bug that could enable malicious validator to send valid bls signature over invalid last commit hash. This could lead to corrupting bls multisig.

One thing we can consider in future, currently check is done at the beginning of the processing function to constrain computing resources, alternative would be to do the check after verifying bls signature as it the signature would be valid it would means that validator (or someone possesing validator bls private key) signed invalid last commit hash, which could be evidence of misbehaviour.

@KonradStaniec KonradStaniec added the bug Something isn't working label Jan 18, 2023
Copy link
Contributor

@gitferry gitferry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix!

One thing we can consider in future, currently check is done at the beginning of the processing function to constrain computing resources, alternative would be to do the check after verifying bls signature as it the signature would be valid it would means that validator (or someone possesing validator bls private key) signed invalid last commit hash, which could be evidence of misbehaviour.

It's interesting to think about. So, if the signature is valid but is signed over a different LastCommitHash, should it be considered as misbehaviour? I'm not sure, the signer might be innocent because he might not know the existence of other forks.

@@ -163,6 +163,31 @@ func FuzzWrappedCreateValidator(f *testing.F) {
})
}

func TestInvalidLastCommitHash(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to make it a Fuzz test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see that it would bring that much value. Here we just want test this concrete bug triggering scenario where message is perfectly valid except for lc hash.

@KonradStaniec
Copy link
Collaborator Author

It's interesting to think about. So, if the signature is valid but is signed over a different LastCommitHash, should it be considered as misbehaviour? I'm not sure, the signer might be innocent because he might not know the existence of other forks.

Yup exactly, this is not really clear cut that why for now we just reject messages with bad last commit hashes.

@KonradStaniec KonradStaniec merged commit 9479188 into dev Jan 19, 2023
@KonradStaniec KonradStaniec deleted the fix-vulnerability-in-checkpointing branch January 19, 2023 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants