-
Notifications
You must be signed in to change notification settings - Fork 925
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
Add stricter checks on signature length #778
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pull Request Test Coverage Report for Build 9748983112Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9749133521Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9749523093Details
💛 - Coveralls |
…rt if more than signature count more than threshold
Pull Request Test Coverage Report for Build 9757675234Details
💛 - Coveralls |
…signer and revert message depends on order of signature type
Pull Request Test Coverage Report for Build 9757956098Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9761738591Details
💛 - Coveralls |
Closing in favor of safe-global/safe-modules#453 The context of the decision is:
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #754
This PR enforces stricter checks on the signature length during verification. The
checkNSignatures
now checks that after completing the signature verification, theoffset
points to the end of the signature data. This ensures that no additional bytes are present than required for the verification to work.Without this change, currently there is no restriction on length of signature submitted for verification due to which an attacker can possibly append additional bytes when using Safe + 4337 module and hit
verificationGasLimit
. This can cause Safe to pay more for verification than needed.Note: A transaction will fail with
GS028
orGS021
based on the how signatures are submitted when signatures contain additional approvals than required threshold. Wallet and other applications have to consider this during error handling if relevant.Changes in PR
Safe
contract checks if signature data does not contain additional bytes data than requiredGS028
Codesize change
This PR
Main branch
Gas implications
TODO
Problem
If the signatures payload contains more approvals from owners than required
threshold
, the signature validation will fail. This is a breaking change for wallet