DatingDapp

First Flight #33
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: low
Invalid

[M-2] Missing Require Statement to Limit Submission of Transactions with a Value Greater Than Contract Funds in ```MultiSigWallet::submitTransaction()```, Leading to Future Failed Transaction Execution.

Description:

The function MultiSigWallet::executeTransaction(uint256 _txId) allows the execution of approved transactions from a multisig wallet. However, there is no validation at the time of transaction creation to ensure that the requested value does not exceed the available funds in the multisig wallet. This can result in transactions being approved but failing at the execution stage due to insufficient funds.

function submitTransaction(
address _to,
uint256 _value
) external onlyOwners {
if (_to == address(0)) revert InvalidRecipient();
if (_value == 0) revert InvalidAmount();
@> // Missing check
transactions.push(Transaction(_to, _value, false, false, false));
uint256 txId = transactions.length - 1;
emit TransactionCreated(txId, _to, _value);
}

Impact:

  • Transactions that exceed the wallet’s balance will fail upon execution, leading to unnecessary transaction approvals and wasted gas costs.

  • Users may approve transactions assuming they will be executed successfully, only to encounter execution failures.

  • This could result in an inefficient user experience and additional operational overhead in reattempting transactions with adjusted values.

Proof of Concept:

  1. Assume the multisig wallet has 3 ETH in balance.

  2. A transaction is created with txn.value = 5 ETH.

  3. The transaction gets approved by both owners.

  4. When calling executeTransaction(_txId), it reaches the following line:

    (bool success, ) = payable(txn.to).call{value: txn.value}("");
    require(success, "Transaction failed");
  5. It will revert, as the value is greater than the multisig's funds.

Recommended Mitigation:

Add a validation check at the moment of transaction creation to prevent transactions with a value greater than the available balance in the multisig wallet.

+ error AmountToBig(uint256 value);
function submitTransaction(
address _to,
uint256 _value
) external onlyOwners {
if (_to == address(0)) revert InvalidRecipient();
if (_value == 0) revert InvalidAmount();
+ if (_value > address(this).balance) revert AmountToBig(_value);
transactions.push(Transaction(_to, _value, false, false, false));
// e el txId sera igual al puesto en el array. por esto el lenght - 1
uint256 txId = transactions.length - 1;
emit TransactionCreated(txId, _to, _value);
}
Updates

Appeal created

n0kto Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Users mistake, only impacting themselves.

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.