MondrianWallet2::executeTransactionFromOutside
allows anyone to execute transactions through the MondrianWallet2
Account Abstraction. It breaks any kind of restriction of the contract and renders it unusable.Description: The function MondrianWallet2::executeTransactionFromOutside
misses a check on the result of MondrianWallet2::_validateTransaction
. _validateTransaction
does not revert when validation fails, but returns bytes4(0)
. Without check, MondrianWallet2::_executeTransaction
will always be called, even when validation of the transaction failed.
Impact: Because of the missing check in executeTransactionFromOutside
, anyone can sign and execute a transaction. It breaks any kind of restriction of the contract, allowing for immediate draining of all funds from the contract (among other actions) and renders it effectively unusable.
Proof of Concept:
A malicious user creates a transaction.
The malicious user signs the transaction with a random signature.
The malicious user calls MondrianWallet2::executeTransactionFromOutside
with the randomly signed transaction.
The transaction does not revert and is successfully executed.
Place the following in ModrianWallet2Test.t.sol
.
Recommended Mitigation: Add a check, using the result from _validateTransaction
. Note that when validation succeeds, _validateTransaction
returns the selector of IAccount::validateTransaction
. MondrianWallet2
already imports this value as ACCOUNT_VALIDATION_SUCCESS_MAGIC
.
Add a check that _validateTransaction
returns the value of ACCOUNT_VALIDATION_SUCCESS_MAGIC
. If the check fails, revert with the error function error MondrianWallet2__InvalidSignature()
. This error function is already present in MondrianWallet2.sol
.
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.