HardhatFoundry
30,000 USDC
View results
Submission Details
Severity: medium
Invalid

K1Validator.sol - Using Solady's SignatureCheckerLib doesn't check for signature malleability

Summary

K1Validator implements vaidateUserOp and inside it uses SignatureCheckerLib.isValidSignatureNow.

function isValidSignatureWithSender(address, bytes32 hash, bytes calldata data) external view returns (bytes4) {
address owner = smartAccountOwners[msg.sender];
// Validate the signature using SignatureCheckerLib
if (SignatureCheckerLib.isValidSignatureNowCalldata(owner, hash, data)) {
return ERC1271_MAGICVALUE;
}
if (SignatureCheckerLib.isValidSignatureNowCalldata(owner, MessageHashUtils.toEthSignedMessageHash(hash), data)) {
return ERC1271_MAGICVALUE;
}
return ERC1271_INVALID;
}

Vulnerability Details

The problem is that SignatureCheckerLib [doesn't check for signature malleability](https://github.com/Vectorized/solady/blob/d5f72a9aa54bc6b2e0b700d6bf3eab29973de0e9/src/utils/SignatureCheckerLib.sol#L23 "doesn't check for signature malleability

(https://github.com/Vectorized/solady/blob/d5f72a9aa54bc6b2e0b700d6bf3eab29973de0e9/src/utils/SignatureCheckerLib.sol#L23)") This means that for the same digest, 2 different valid signatures can be used.

Impact

Signature malleability

Tools Used

Manual Review

Recommendations

Consider verifying the s of the userOp.signature is within valid bounds to avoid signature malleability.

Updates

Lead Judging Commences

0xnevi Lead Judge 11 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-replay-attack-malleable

Valid medium, although all issues lack a little detail on some form of protocol specific impact here. See similar reference finding [here](https://github.com/sherlock-audit/2024-04-titles-judging/issues/279)

Appeal created

0xnevi Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Other
Assigned finding tags:

finding-replay-attack-malleable

Valid medium, although all issues lack a little detail on some form of protocol specific impact here. See similar reference finding [here](https://github.com/sherlock-audit/2024-04-titles-judging/issues/279)

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.