Connext Amarok contest - jayjonah8's results

The interoperability protocol of L2 Ethereum.

General Information

Platform: Code4rena

Start Date: 08/06/2022

Pot Size: $115,000 USDC

Total HM: 26

Participants: 72

Period: 11 days

Judge: leastwood

Total Solo HM: 14

Id: 132

League: ETH

Connext

Findings Distribution

Researcher Performance

Rank: 59/72

Findings: 1

Award: $141.86

🌟 Selected for report: 0

🚀 Solo Findings: 0

Equality check with different uint sizes can cause failures

Lines of code

https://github.com/code-423n4/2022-06-connext/blob/main/contracts/contracts/core/connext/facets/BridgeFacet.sol#L283 https://github.com/code-423n4/2022-06-connext/blob/main/contracts/contracts/core/connext/libraries/LibConnextStorage.sol#L146 https://github.com/code-423n4/2022-06-connext/blob/main/contracts/contracts/core/connext/libraries/LibConnextStorage.sol#L41

Vulnerability details

Impact

In BridgeFacet.sol the xcall() function checks if _args.params.originDomain != s.domain and it will revert if these are not equal. The problem is that the originDomain is a uint32 and the s.domain is a uint256. This means that if the s.domain number is ever larger than the max value for a uint32 value, this function will fail every time because the originDomain could never reach a large enough number.

Proof of Concept

https://github.com/code-423n4/2022-06-connext/blob/main/contracts/contracts/core/connext/facets/BridgeFacet.sol#L283

https://github.com/code-423n4/2022-06-connext/blob/main/contracts/contracts/core/connext/libraries/LibConnextStorage.sol#L146

https://github.com/code-423n4/2022-06-connext/blob/main/contracts/contracts/core/connext/libraries/LibConnextStorage.sol#L41

Tools Used

Manual code review

The _args.params.originDomain and the s.domain should both be the same uint type. They both should be either a uint32 or uint256 to avoid any possible failures due to numbers not being large enough.

#0 - jakekidd

2022-06-25T02:24:21Z

This is a QA issue - basically, it's possible for Owner to produce a bad configuration, using an invalid domain ID (official domain IDs are listed by Nomad and all conform to being uint32).

#2 - 0xleastwood

2022-08-15T00:24:06Z

I mean this isn't really an issue but a worthwhile QA for consistent equality checking.

#3 - 0xleastwood

2022-08-15T00:24:19Z

Downgrading to QA.

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