This repository has been archived by the owner on Nov 12, 2023. It is now read-only.
aviggiano - Chainlink adaptors don't check If Arbitrum sequencer is down #150
Labels
Non-Reward
This issue will not receive a payout
aviggiano
medium
Chainlink adaptors don't check If Arbitrum sequencer is down
Summary
When utilizing Chainlink in L2 chains like Arbitrum, it's important to ensure that the prices provided are not falsely perceived as fresh, even when the sequencer is down. This vulnerability could potentially be exploited by malicious actors to gain an unfair advantage.
Vulnerability Detail
The functions
JOJOOracleAdaptor.getAssetPrice
andChainlinkExpandAdaptor.getMarkPrice
do not check if the sequencer is down or not.If a sequencer becomes unavailable, it is impossible to access read/write APIs that consumers are using and applications on the L2 network will be down for most users without interacting directly through the L1 optimistic rollup contracts. The L2 has not stopped, but it would be unfair to continue providing service on your applications when only a few users can use them.
To help your applications identify when the sequencer is unavailable, protocols should use a data feed that tracks the last known status of the sequencer at a given point in time. This helps prevent mass liquidations by providing a grace period to allow customers to react to such an event.
References:
Impact
The price recorded by latestRoundData will be inaccurate since the true price won't be reported to the chain due to the sequence being down. This could lead to users being reported an outdated price.
Code Snippet
https://github.com/sherlock-audit/2023-04-jojo/blob/main/JUSDV1/src/oracle/JOJOOracleAdaptor.sol#L26-L35
https://github.com/sherlock-audit/2023-04-jojo/blob/main/smart-contract-EVM/contracts/adaptor/chainlinkAdaptor.sol#L43-L55
Tool used
Manual Review
Recommendation
It is recommended to follow the code example of Chainlink:
https://docs.chain.link/data-feeds/l2-sequencer-feeds#example-code
Duplicate of #101
The text was updated successfully, but these errors were encountered: