Description: The MondrianWallet2
contract uses a low-level call in its executeTransaction
function without properly handling the possibility of a failed execution. While the contract does revert with a custom error MondrianWallet2__ExecutionFailed()
, it doesn't distinguish between different types of failures, which could lead to unexpected behavior and potential loss of funds.
Impact: If a transaction fails due to reasons other than running out of gas (e.g., the called contract reverts), the wallet contract will revert, but it won't provide any detailed information about the failure. This lack of granularity in error handling could make it difficult for users and integrating systems to understand why a transaction failed, potentially leading to repeated failed attempts or misinterpretation of the contract's state.
Proof of Concept:
Below is the test code which proves that there is a insecure external call done by the executeTransaction
method.
Paste this code in the new test file and see the result
Recommended Mitigation:
Use a try-catch block to handle the low-level call and capture more detailed error information:
Consider using OpenZeppelin's Address.functionCall or similar utilities that provide more robust error handling for low-level calls.
Implement a way to return detailed error information to the caller, possibly through events or returnable error codes.
Add extensive logging (events) for both successful and failed transactions to aid in debugging and monitoring.
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.