Connext Amarok contest - bardamu'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: 50/72

Findings: 1

Award: $195.02

🌟 Selected for report: 0

🚀 Solo Findings: 0

Data returned from ChainLink aggregator is unchecked and could be stale/outdated

Lines of code

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

Vulnerability details

Impact

Price data returned by latestRoundData could be stale. This would create a situation where any contract consuming price information from Connext's oracle module would rely on an incorrect asset price.

Proof of Concept

As can be seen in function getPriceFromChainlink the answer from aggregator.latestRoundData() is assumed to be valid if it is non-zero and returned to the caller in getTokenPrice. However, aggregator data could be stale and therefore be outdated, which would propagate an incorrect price.

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

Tools Used

vim

The caller should always check that latestRoundData is returning sane and up to date values.

Properties updatedAt and answeredInRound are of particular interest here. For example, answeredInRound could be checked against the current roundId to verify price information has been updated within a certain threshold.

function latestRoundData() public override view checkAccess() returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ) { return super.latestRoundData(); }

#0 - ecmendenhall

2022-06-20T05:31:24Z

Duplicate of #190

#1 - jakekidd

2022-06-24T21:40:05Z

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