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.
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.
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.
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.
If one owner refuses to approve a transaction, it remains pending forever, leading to a situation where funds might become locked indefinitely.
The contract accepts ETH but does not track deposits, making it difficult to manage and retrieve balances.
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.
Slither for static analysis
MythX for vulnerability detection
Manual Review to identify logic-based issues
✅ 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.
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.