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 (SignatureUtils): check the EIP-1271 call result more strictly #714

Conversation

skozin
Copy link
Member

@skozin skozin commented Mar 28, 2023

Makes sure that:

  1. the returned data is exactly 32 bytes long;
  2. only the first 4 bytes are non-zero;
  3. these 4 bytes contain the magic value.

This doesn't support contracts that right-pad the magic value with zeroes to a size longer than 32 bytes like the Solidity ABI decoder currently allows, but that's a really exotic edge case since it breaks the ABI specification for the bytes4 return data type.

Make sure that 1) the returned data size is exactly 32 bytes; 2) only the first 4 bytes are non-zero; 3) these 4 bytes contain the magic value

This doesn't support contracts right-padding the magic value with zeroes to a size longer than 32 bytes, like the Solidity ABI decoder allows, but that's a really exotic edge-case
Copy link
Contributor

@TheDZhon TheDZhon left a comment

Choose a reason for hiding this comment

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

👍

@TheDZhon TheDZhon merged commit 7e59e84 into fix/shapella-upgrade-from-rc0-to-rc1 Mar 30, 2023
@TheDZhon TheDZhon deleted the fix/is-valid-signature-eip1271-size-check branch March 30, 2023 16:21
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.

2 participants