Connext Amarok contest - JMukesh'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: 51/72

Findings: 1

Award: $163.33

🌟 Selected for report: 0

🚀 Solo Findings: 0

L1. Specs not according to the comment

Impact

function _originAndNonce(uint32 _origin, uint32 _nonce) internal pure returns (uint64) {

return (uint64(_origin) << 32) | _nonce; }

In comment it mention the return value should be (_origin << 32) & _nonce

but in function it is (uint64(_origin) << 32) | _nonce;

Proof of Concept

https://github.com/code-423n4/2022-06-connext/blob/b4532655071566b33c41eac46e75be29b4a381ed/contracts/contracts/core/relayer-fee/RelayerFeeRouter.sol#L163

Tools Used

manual review

upadate the comment wrt current functionality, since (_origin << 32) & _nonce it returns 0 value irrespective of any input

L2. lack of checks for the length in input parmeters

Impact

`function setAggregators(address[] calldata tokenAddresses, address[] calldata sources) external onlyAdmin {

// @audit --> add the checks for the length for (uint256 i = 0; i < tokenAddresses.length; i++) { aggregators[tokenAddresses[i]] = AggregatorV3Interface(sources[i]); emit AggregatorUpdated(tokenAddresses[i], sources[i]); }

} ` due to lack of checks , whether both arrays length are equal or not, it may cause function to fail

Proof of Concept

https://github.com/code-423n4/2022-06-connext/blob/b4532655071566b33c41eac46e75be29b4a381ed/contracts/contracts/core/connext/helpers/ConnextPriceOracle.sol#L175

Tools Used

manual review

add the checks for the length

L3. Lack of input validationn for address array

Impact

There is no checking of address array in setAggregator() , it may contain duplicate address or zero address due which function may get failed

Proof of Concept

https://github.com/code-423n4/2022-06-connext/blob/b4532655071566b33c41eac46e75be29b4a381ed/contracts/contracts/core/connext/helpers/ConnextPriceOracle.sol#L176

Tools Used

manual review

check the address before using it in loop

L4. add a two step function to update the admin address

impact

Lack of two-step procedure for critical operations leaves them error-prone if the address is incorrect, the new address will take on the functionality of the new role immediately

for Ex : -Alice deploys a new version of the whitehack group address. When she invokes the whitehack group address setter to replace the address, she accidentally enters the wrong address. The new address now has access to the role immediately and is too late to revert

https://raw.githubusercontent.com/trailofbits/publications/master/reviews/hermez.pdf

Proof of Concept

https://github.com/code-423n4/2022-06-connext/blob/b4532655071566b33c41eac46e75be29b4a381ed/contracts/contracts/core/connext/helpers/ConnextPriceOracle.sol#L168

Tools Used

manual review

use a two-step procedure for all non-recoverable critical operations to prevent
irrecoverable mistakes.

L5. Lack of access modifier in initialize() function

Impact

Initialize() , Initializes important contract state that can be called by anyone. Since it lacks an access modifier, an attacker can initialize the contract before the legitimate deployer.

Proof of Concept

contracts which uses initialize(), they all lack access modifier some of the links are:

bridgetoken.sol

RelayaerFeeRouter.sol

PromiseRouter.sol

Tools Used

manual review

add access modifier in intialize function

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