MondrianWallet::_validateSignature
does not check if the address recovered by ECDSA.recover(hash, userOp.signature);
matches the expected (accepted) signer's address. This oversight allows unauthorized users to execute transactions.
MondrianWallet::_validateSignature
is supposed to
STEP1: recover the signer of the submitted userOp
using the EDSA.recover
method,
STEP2: validate the signer's address matches the address (or addresses) that are authorized to sign UserOperation
s, and then
STEP3: depending on the success or failure of the validation, return an approriate value.
In practice, however, the STEP2 (signature validation against accepted addresses) is omitted, while at STEP3 the return value is always SIG_VALIDATION_SUCCESS
.
Due to the missing signature validation, MondrianWallet
will accept and execute any userOp
that has been signed by any user, provided that the other fields of the userOp
are valid (such ad nonce
). This vulnerability allows any user to execute arbitrary transactions through the MondrianWallet
by submitting a userOp
via iEntryPoint::handleOps
.
The following piece of test demonstrates that a non-owner user signs a UserOp
for minting ERC20
tokens via the owner
's MondrianWallet
. Despite the user not having a signed transaction from the Mondrian Wallet Owner, the transactions executes,
Note: the test was written in Foundry.
Manual review, Foundry.
implement the missing signature validation step in _validateSignature
: ensure that the recovered address matches the expected signer's address (i.e., the wallet owner). The function should return SIG_VALIDATION_FAILED
if the signature does not match the owner's address.
Here is the recommended code change:
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.