Maia DAO - Ulysses - wangxx2026'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: 73/175

Findings: 1

Award: $39.20

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Labels

bug
2 (Med Risk)
downgraded by judge
partial-50
sufficient quality report
edited-by-warden
duplicate-348

Awards

39.2026 USDC - $39.20

External Links

Lines of code

https://github.com/code-423n4/2023-09-maia/blob/f5ba4de628836b2a29f9b5fff59499690008c463/src/RootBridgeAgent.sol#L1204-L1217 https://github.com/code-423n4/2023-09-maia/blob/f5ba4de628836b2a29f9b5fff59499690008c463/src/BranchBridgeAgent.sol#L936-L944

Vulnerability details

Impact

lzreceive is not working properly

Proof of Concept

The entire link to interact with lz is: bridgeAgent.lz.send->validateTransactionProof (off-chain service)->lz.receivePayload->bridgeAgent.lzReceive

The second parameter calldata _srcAddress received by lzReceive is passed by lz:

bytes memory pathData = abi.encodePacked(_packet.srcAddress, _packet.dstAddress); // msg.sender is stored in the first 20 bytes, 

For details, please refer to the source code of lz

https://arbiscan.io/address/0x4D73AdB72bC3DD368966edD0f0b2148401A178E2#code

You can also refer to the mock version https://github.com/LayerZero-Labs/solidity-examples/blob/main/contracts/lzApp/mocks/LZEndpointMock.sol

The usage in the code is as follows // found

    function _requiresEndpoint(address _endpoint, bytes calldata _srcAddress) internal view virtual {
        //Verify Endpoint
        if (msg.sender != address(this)) revert LayerZeroUnauthorizedEndpoint();
        if (_endpoint != lzEndpointAddress) revert LayerZeroUnauthorizedEndpoint();

        //Verify Remote Caller
        if (_srcAddress.length != 40) revert LayerZeroUnauthorizedCaller();
        if (rootBridgeAgentAddress != address(uint160(bytes20(_srcAddress[20:])))) revert LayerZeroUnauthorizedCaller(); // found
    }

The last 20 bytes obtained from _srcAddress are dstAddr, and here we want to limit the caller, so we should get the first 20 bytes.

Tools Used

Manual Review

Get msg.sender using first 20 bytes of _srcAddress

Assessed type

Access Control

#0 - c4-pre-sort

2023-10-13T05:50:49Z

0xA5DF marked the issue as duplicate of #439

#1 - c4-pre-sort

2023-10-13T05:50:53Z

0xA5DF marked the issue as sufficient quality report

#2 - c4-judge

2023-10-26T09:42:13Z

alcueca changed the severity to 2 (Med Risk)

#3 - c4-judge

2023-10-26T09:45:20Z

alcueca marked the issue as satisfactory

#4 - c4-judge

2023-10-26T09:52:31Z

alcueca marked the issue as partial-50

#5 - alcueca

2023-10-26T09:52:31Z

There are very high effort submissions in this duplicate group. All others are getting 50% so that the few very high effort ones get double rewards.

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