DatingDapp

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

Security Analysis of MultiSigWallet Smart Contract

Summary

The MultiSigWallet contract facilitates a secure and decentralized way to manage transactions between two owners. It allows for transaction submission, approval, and execution once both owners approve. The updated version introduces gas optimizations and better error handling while preserving core multi-signature logic. However, it still has critical vulnerabilities that could impact security and efficiency.

Vulnerability Details

1️⃣ Reentrancy Risk in executeTransaction

  • The function executes a transaction using .call{value: txn.value}(""), which allows reentrancy if the recipient contract has a fallback function executing further logic.

  • If an external contract initiates reentrant execution, it could manipulate approvals before execution finalizes.

2️⃣ Unrestricted Transaction Submission

  • Currently, anyone can submit a transaction to the contract.

  • This allows attackers to flood the contract with fake transactions, making it inefficient and costly to manage.

3️⃣ Denial of Service (DoS) via Storage Bloat

  • Since all transactions remain stored, attackers can spam the contract with unnecessary submissions, making it expensive for owners to interact with the contract over time.

4️⃣ No Expiration Mechanism for Pending Transactions

  • If one owner refuses to approve a transaction, it remains pending forever, leading to a situation where funds might become locked indefinitely.

5️⃣ Untracked ETH Deposits

  • The contract accepts ETH but does not track deposits, making it difficult to manage and retrieve balances.

Impact

1️⃣ Reentrancy Attack (High Impact)

  • If an attacker deploys a malicious contract with a fallback function, they could repeatedly reenter executeTransaction() before the transaction state updates. This could lead to unauthorized withdrawals and potential fund loss.

2️⃣ Denial of Service via Transaction Spam (Medium Impact)

  • Since the contract allows unrestricted transaction submissions, malicious users can flood it with fake transactions. This increases gas costs and can make the contract difficult for owners to use effectively.

3️⃣ Stale Pending Transactions (Medium Impact)

  • Transactions remain indefinitely pending if one owner refuses to approve them. This can lock funds indefinitely if there is no way to cancel outdated transactions.

4️⃣ Untracked ETH Deposits (Low Impact)

  • The contract accepts ETH without tracking deposits, which could cause confusion regarding fund ownership. Additionally, users might send ETH by mistake, and there is no mechanism to return unintended deposits.

Tools Used

  • Slither for static analysis

  • MythX for vulnerability detection

  • Manual Review to identify logic-based issues

Recommendations

Prevent Reentrancy

  • Use ReentrancyGuard to prevent reentrant execution.

  • Modify executeTransaction() to update state before external calls.

Restrict Transaction Submission

  • Ensure that only the owners can submit transactions.

Optimize Storage Management

  • Implement a mechanism to remove executed transactions or set a limit on the transaction array size.

Introduce Auto-Cancellation for Pending Transactions

  • Implement an expiration period after which unapproved transactions get removed automatically.

Track ETH Deposits Properly

  • Maintain a mapping of deposits per owner and allow only specific deposits.

Updates

Appeal created

n0kto Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Too generic

Support

FAQs

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