Mondrian wallet has a missing explicit check of the (ECDSA.recover ) function's return value.that return address(0) with invalid operation signature .
If the signature is invalid or the recovery fails, ECDSA.recover might not return the expected value (address(0)).
The current implementation directly returns SIG_VALIDATION_SUCCESS irrespective of the ECDSA.recover outcome. This could lead to a vulnerability i:
The flawed validation process accepts the UserOp as valid due to the missing check.
the check-in handleOps function in the entrypoint contract based on this function
function validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash, uint256 missingAccountFunds)
external
virtual
override
requireFromEntryPoint
returns (uint256 validationData)
{
validationData = _validateSignature(userOp, userOpHash);
** _validateNonce(userOp.nonce);
_payPrefund(missingAccountFunds);
}
Unauthorized transactions could be processed through the EntryPoint contract if the signature validation is bypassed.
manuale review, remix
the Entry Point in ERC-4337 typically doesn't directly check the validation of the signature within a UserOperation.
need to check the returned address if it valid one
revert if the return is address(0)
Solidity
function _validateSignature(PackedUserOperation calldata userOp, bytes32 userOpHash)
internal
pure
returns (uint256 validationData)
{
bytes32 hash = MessageHashUtils.toEthSignedMessageHash(userOpHash);
address recoveredAddress = ECDSA.recover(hash, userOp.signature);
// check address with a mapping or carry to check this address is a valid one because there is no aggregator contract
// Check if the recovered address is valid (not zero)
require(recoveredAddress != address(0), "Invalid signature");
// Additional security checks based on recoveredAddress (optional)
return SIG_VALIDATION_SUCCESS;
}
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.