Maia DAO - Ulysses - 7ashraf'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: 111/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/BranchPort.sol#L355 https://github.com/code-423n4/2023-09-maia/blob/main/src/BranchPort.sol#L375 https://github.com/code-423n4/2023-09-maia/blob/main/src/BranchPort.sol#L396 https://github.com/code-423n4/2023-09-maia/blob/main/src/RootPort.sol#L369 https://github.com/code-423n4/2023-09-maia/blob/main/src/RootPort.sol#L414 https://github.com/code-423n4/2023-09-maia/blob/main/src/RootPort.sol#L431

Vulnerability details

Toggle function overwrites the create function with potential DOS risks

Instances

BranchPort.sol #348 https://github.com/code-423n4/2023-09-maia/blob/main/src/BranchPort.sol#L348

 function toggleBridgeAgentFactory(address _newBridgeAgentFactory) external override requiresCoreRouter {
        isBridgeAgentFactory[_newBridgeAgentFactory] = !isBridgeAgentFactory[_newBridgeAgentFactory];

        emit BridgeAgentFactoryToggled(_newBridgeAgentFactory);
    }

BranchPort.sol#355 https://github.com/code-423n4/2023-09-maia/blob/main/src/BranchPort.sol#L355

BranchPort.sol#375 https://github.com/code-423n4/2023-09-maia/blob/main/src/BranchPort.sol#L375

BranchPort.sol#396 https://github.com/code-423n4/2023-09-maia/blob/main/src/BranchPort.sol#L396

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

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

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

Description

The toggle function checks inverts the value foo inside of isFoo[] array, which is part of adding creating a foo through the creation method.

Proof of concept

The function toggleBridgeAgentFactory reverts the isBridgeAgentFactory[_newBridgeAgentFactory] value, in case bridge agent factory of address 0x123 did not exist before will now has isBridgeAgentFactory[address] equal to true.

which is the same as creating a new branch bridge agent factory, the only difference that the logic will be missing the bridgeAgentFactories.push(_newBridgeAgentFactory); and the event will not be emmitted.

Impact

  • breaking the logic of the creation function
  • potential locked, DOS branch bridge agent factories
  • potential locked funds due to strategy tokens not existing the in the strategyTokens array

Mitigation

  • Need to check if foo exists first before toggling its state, if exists already, then proceed to toggle, if not exists, either revert or add new foo then togggle the state.
  • emit an event on toggle functions,

Assessed type

DoS

#0 - c4-pre-sort

2023-10-07T13:38:10Z

0xA5DF marked the issue as low quality report

#1 - 0xA5DF

2023-10-07T13:38:15Z

Those are mappings, not arrays

#2 - alcueca

2023-10-23T06:03:41Z

Unsafe logic, no impact demonstrated. Valid QA.

#3 - c4-judge

2023-10-23T06:03:55Z

alcueca changed the severity to QA (Quality Assurance)

#4 - c4-judge

2023-10-23T06:04:00Z

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