Maia DAO - Ulysses - ustas's results

Harnessing the power of Arbitrum, Ulysses Omnichain specializes in Virtualized Liquidity Management.

General Information

Platform: Code4rena

Start Date: 22/09/2023

Pot Size: $100,000 USDC

Total HM: 15

Participants: 175

Period: 14 days

Judge: alcueca

Total Solo HM: 4

Id: 287

League: ETH

Maia DAO

Findings Distribution

Researcher Performance

Rank: 93/175

Findings: 2

Award: $25.79

QA:
grade-a

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2023-09-maia/blob/ffbe532c6f5224a55ce099b4016bd8806bdbc913/src/VirtualAccount.sol#L85-L112

Vulnerability details

Impact

The current implementation allows anyone to exploit the VirtualAccount.payableCall() function to initiate unauthorized withdrawals of all ERC20/721/1155 tokens held by a virtual account. However, it's important to note that native tokens cannot be withdrawn in this manner due to a validation check at the end of the function sum(.call) == msg.value. This vulnerability poses a risk of token loss and unauthorized access to assets within virtual accounts, potentially compromising the security and integrity of the system.

Proof of Concept

https://github.com/code-423n4/2023-09-maia/blob/ffbe532c6f5224a55ce099b4016bd8806bdbc913/src/VirtualAccount.sol#L85 https://github.com/code-423n4/2023-09-maia/blob/ffbe532c6f5224a55ce099b4016bd8806bdbc913/src/VirtualAccount.sol#L101

Tools Used

Manual review

Add requiresApprovedCaller to the function

Assessed type

Access Control

#0 - c4-pre-sort

2023-10-08T14:30:44Z

0xA5DF marked the issue as duplicate of #888

#1 - c4-pre-sort

2023-10-08T14:40:27Z

0xA5DF marked the issue as sufficient quality report

#2 - c4-judge

2023-10-26T11:31:35Z

alcueca marked the issue as satisfactory

Low issues

  1. Implementation of the ERC20 by Solmate in ERC20hTokenRoot and ERC20hTokenBranch doesn't support increaseAllowance() and decreaseAllowance() which can lead to known problems with ERC20. It might be better to use OpenZeppelin's implementation of ERC20. https://forum.openzeppelin.com/t/explain-the-practical-use-of-increaseallowance-and-decreaseallowance-functions-on-erc20/15103/2 https://github.com/code-423n4/2023-09-maia/blob/ffbe532c6f5224a55ce099b4016bd8806bdbc913/src/token/ERC20hTokenRoot.sol#L6 https://github.com/code-423n4/2023-09-maia/blob/ffbe532c6f5224a55ce099b4016bd8806bdbc913/src/token/ERC20hTokenRoot.sol#L12 https://github.com/code-423n4/2023-09-maia/blob/ffbe532c6f5224a55ce099b4016bd8806bdbc913/src/token/ERC20hTokenBranch.sol#L12

  2. There's no VirtualAccount.withdrawERC1155(), which might affect UX because the only way to withdraw ERC1155 token is to use raw and dangerous VirtualAccount.call(). Other standards (ERC20 and ERC721) have their respective .withdraw functions. https://github.com/code-423n4/2023-09-maia/blob/ffbe532c6f5224a55ce099b4016bd8806bdbc913/src/VirtualAccount.sol#L55-L63

  3. There's no need to implement the getFeeEstimate() in ArbitrumBranchBridgeAgent since it doesn't use LayerZero. The function might be misleading to the users. https://github.com/code-423n4/2023-09-maia/blob/ffbe532c6f5224a55ce099b4016bd8806bdbc913/src/BranchBridgeAgent.sol#L161-L173

  4. There's a duplicate of BranchPort.setCoreBranchRouter() in the form of BranchPort.setCoreRouter(). Both functions change the coreBranchRouterAddress state variable, but the second one isn't used anywhere in the system and is gated (so cannot be called as external function). https://github.com/code-423n4/2023-09-maia/blob/ffbe532c6f5224a55ce099b4016bd8806bdbc913/src/BranchPort.sol#L331-L335 https://github.com/code-423n4/2023-09-maia/blob/ffbe532c6f5224a55ce099b4016bd8806bdbc913/src/BranchPort.sol#L414-L424

  5. Unnecessary concatenation and casting to string string(string.concat(_name)) and string(string.concat(_symbol)). This can be replaced with just _name and _symbol. https://github.com/code-423n4/2023-09-maia/blob/ffbe532c6f5224a55ce099b4016bd8806bdbc913/src/token/ERC20hTokenRoot.sol#L38

  6. Comments and names of the mappings tell that the first argument is chainId, but in fact, it is the second argument. https://github.com/code-423n4/2023-09-maia/blob/ffbe532c6f5224a55ce099b4016bd8806bdbc913/src/RootPort.sol#L89-L101 Examples of use: https://github.com/code-423n4/2023-09-maia/blob/ffbe532c6f5224a55ce099b4016bd8806bdbc913/src/RootPort.sol#L195 https://github.com/code-423n4/2023-09-maia/blob/ffbe532c6f5224a55ce099b4016bd8806bdbc913/src/RootPort.sol#L196 https://github.com/code-423n4/2023-09-maia/blob/ffbe532c6f5224a55ce099b4016bd8806bdbc913/src/RootPort.sol#L231

#0 - c4-pre-sort

2023-10-15T13:12:52Z

0xA5DF marked the issue as sufficient quality report

#1 - 0xA5DF

2023-10-15T13:13:03Z

2 is dupe of #408 TODO

#2 - alcueca

2023-10-21T12:49:32Z

#408 will be judged as Low

#3 - c4-judge

2023-10-21T12:50:32Z

alcueca marked the issue as grade-a

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter