Maia DAO - Ulysses - bronze_pickaxe'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: 100/175

Findings: 1

Award: $25.68

QA:
grade-a

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2023-09-maia/blob/main/src/RootBridgeAgent.sol#L436

Vulnerability details

Impact

In Summer 2022, the LayerZero team updated their chainIds. For example, main-net chainId used to be 1 - which got updated to 101.

Therefore, the team advises every project that incorporates LayerZero to not hardcode the chainId's because they can be updated by the LayerZero team in the future. You can find this advice in their LayerZero Integration Checklist.

Ulysses makes use of chainId's everywhere in the project.

In BranchBridgeAgent.sol, RootBridgeAgent.sol, lzReceive receives the _srcChainId, which is the chainID from the chain that has sent the message. This _srcChainId

The _srchChainId is used everywhere. It is used to update state variables like the executionNonce.

executionState[_srcChainId][nonce] = STATUS_RETRIEVE;

executionState[_srcChainId][_depositNonce] = STATUS_DONE;

executionState[_srcChainId][_depositNonce] = STATUS_DONE;

_srcChainId is also used for checking if localTokens or globalTokens exist, it is used to perform _performFallback.

Ulysses also uses localChainId in multiple contracts. For example, in RootBridgeAgent.sol, localChainID is used to check if destination chainID == localChainId:

if (_dstChainId != localChainId) {

Impact

The project won't be able to function properly anymore, this includes problems like:

  • hToken/localToken/GlobalToken validations will stop working.
  • funds stuck in Ports.
  • unexpected behaviour with state variables.
  • BranchBridgeAgent validations will stop working.

Tools Used

Manual Review.

Add a admin restricted setter to change the ChainId.

Assessed type

Other

#0 - c4-pre-sort

2023-10-12T07:39:00Z

0xA5DF marked the issue as duplicate of #415

#1 - c4-pre-sort

2023-10-12T07:39:08Z

0xA5DF marked the issue as sufficient quality report

#2 - c4-pre-sort

2023-10-12T07:39:17Z

0xA5DF marked the issue as high quality report

#3 - c4-pre-sort

2023-10-12T07:39:55Z

0xA5DF marked the issue as sufficient quality report

#4 - c4-judge

2023-10-26T10:42:16Z

alcueca changed the severity to QA (Quality Assurance)

#5 - c4-judge

2023-10-26T10:43:27Z

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