Maia DAO - Ulysses - 0xDemon'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: 150/175

Findings: 1

Award: $11.47

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Updating the state after an external call can be a loophole for reentrancy

In several internal functions in the BranchBridgeAgent and RootBridgeAgent contracts, there is a contract structure that is not in accordance with best practice Check-Effect-Interactions where after making an external call there is a state update, this could be a gap for reentrancy in this function.

There are four instances of this issue :

File : src/BranchBridgeAgent.sol 

831	  Deposit storage deposit = getDeposit[_depositNonce];
832       deposit.owner = _refundee;
833
834       addressArray[0] = _hToken;
835       deposit.hTokens = addressArray;
836
837       addressArray[0] = _token;
838       deposit.tokens = addressArray;
839
840       uintArray[0] = _amount;
841       deposit.amounts = uintArray;
842
843       uintArray[0] = _deposit;
844       deposit.deposits = uintArray;
845
846       deposit.status = STATUS_SUCCESS;

881	  Deposit storage deposit = getDeposit[_depositNonce];
882       deposit.owner = _refundee;
883       deposit.hTokens = _hTokens;
884       deposit.tokens = _tokens;
885       deposit.amounts = _amounts;
886       deposit.deposits = _deposits;
887       deposit.status = STATUS_SUCCESS;

GitHub : 831 - 846, 881 - 887

File : src/RootBridgeAgent.sol 

1014        settlement.owner = _refundee;
1015        settlement.recipient = _recipient;
1016
1017        addressArray[0] = localAddress;
1018        settlement.hTokens = addressArray;
1019
1020        addressArray[0] = underlyingAddress;
1021        settlement.tokens = addressArray;
1022
1023        uintArray[0] = _amount;
1024        settlement.amounts = uintArray;
1025
1026        uintArray[0] = _deposit;
1027        settlement.deposits = uintArray;
1028
1029        settlement.dstChainId = _dstChainId;
1030        settlement.status = STATUS_SUCCESS;

1106        settlement.owner = _refundee;
1107        settlement.recipient = _recipient;
1108        settlement.hTokens = hTokens;
1109        settlement.tokens = tokens;
1110        settlement.amounts = _amounts;
1111        settlement.deposits = _deposits;
1112        settlement.dstChainId = _dstChainId;
1113        settlement.status = STATUS_SUCCESS;

GitHub : 1014 - 1030, 1106 - 1113

#0 - c4-pre-sort

2023-10-15T13:04:18Z

0xA5DF marked the issue as sufficient quality report

#1 - c4-judge

2023-10-21T12:38:32Z

alcueca marked the issue as grade-b

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