This repository has been archived by the owner on Nov 12, 2023. It is now read-only.
kaysoft - Missing check for Whether Chainlink L2 sequencer is ACTIVE in getMarkPrice() function #233
Labels
Non-Reward
This issue will not receive a payout
kaysoft
high
Missing check for Whether Chainlink L2 sequencer is ACTIVE in getMarkPrice() function
Summary
The
getMarkPrice
function of the chainlinkAdaptor.sol file does not check for whether the sequence is active as recommeded by chainlink for getting price feeds on L2 networks like Arbitrum.Chainlink recommends that for L2 like Arbitrum, applications should check if the sequencer is available by using data feeds that tracks the last known of the sequencer at a given point in time in order to prevent mass liquidations by providing a grace period to allow users to react to such an event.
Please read: https://docs.chain.link/data-feeds/l2-sequencer-feeds
Vulnerability Detail
The
getMarkPrice
function of the chainlinkAdaptor.sol file does not check for whether the sequence is active as recommended by chainlink for getting price feeds on L2 networks like Arbitrum.Checks for sequencer uptime should be implemented and revert if the sequencer is down.
Take a look at this example code on Chainlink Docs: https://docs.chain.link/data-feeds/l2-sequencer-feeds#example-code
Impact
If the sequencer goes down, stale prices may be returned and for example if USDC were to de-peg while the sequencer is offline, stale price is used and can result in massive false liquidation and over-borrowing.
Code Snippet
https://github.com/JOJOexchange/smart-contract-EVM/blob/4a95a8e9a6367ae88dc827e29467229cb5bbad4f/contracts/adaptor/chainlinkAdaptor.sol#L43
Tool used
Manual Review
Recommendation
Implement the chainlink L2 sequencer check since the contract will be deployed to Arbitrum. Take a look at this example here: https://docs.chain.link/data-feeds/l2-sequencer-feeds
Duplicate of #101
The text was updated successfully, but these errors were encountered: