The MondrianWallet2::_executeTransaction
function lacks a defined gas limit for transaction execution, potentially allowing malicious actors to construct transactions with computationally expensive operations.
This oversight can lead to a gas depletion attack, where maliciously crafted transactions consume excessive gas, thereby blocking or delaying the execution of legitimate transactions on the network.
Craft a transaction with complex data, such as a large byte array.
Attempt to execute the transaction on the MondrianWallet2
contract.
Observe the transaction fail due to gas exhaustion, indicating the vulnerability to denial-of-service attacks through gas depletion.
To simulate realistic conditions similar to mainnet and testnet, we can set a gas limit of around 12 to 15 million for our tests.
Copy the following test in the test suite.
Execute it with the command forge test --mt testDenialOfService --gas-limit 15000000
. 15.000.000 being a realistic gas limit.
This attack can disrupt protocol operations, leading to transaction delays and failures, financial losses, and user dissatisfaction. It can also contribute to network congestion and damage the contract's reputation.
Manual review
Consider setting a gas limit inside the MondrianWallet2::_executeTransaction
function:
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.