sherlock-audit / 2023-04-blueberry-judging

8 stars 5 forks source link

ctf_sec - Missing checks for whether Arbitrum Sequencer is active #142

Open sherlock-admin opened 1 year ago

sherlock-admin commented 1 year ago

ctf_sec

medium

Missing checks for whether Arbitrum Sequencer is active

Summary

Missing checks for whether Arbitrum Sequencer is active

Vulnerability Detail

the onchain deployment context is changed, in prev contest the protocol only attemps to deploy the code to ethereum while in the current contest

the protocol intends to deploy to arbtrium as well!

Chainlink recommends that users using price oracles, check whether the Arbitrum sequencer is active

https://docs.chain.link/data-feeds#l2-sequencer-uptime-feeds

If the sequencer goes down, the index oracles may have stale prices, since L2-submitted transactions (i.e. by the aggregating oracles) will not be processed.

Impact

Stale prices, e.g. if USDC were to de-peg while the sequencer is offline, stale price is used and can result in false liquidation or over-borrowing.

Code Snippet

https://github.com/sherlock-audit/2023-04-blueberry/blob/main/blueberry-core/contracts/oracle/ChainlinkAdapterOracle.sol#L76-L98

Tool used

Manual Review

Recommendation

Use sequencer oracle to determine whether the sequencer is offline or not, and don't allow orders to be executed while the sequencer is offline.

Gornutz commented 1 year ago

https://github.com/Blueberryfi/blueberry-core/commit/f119662791d2368a98b2db1ba609365f9fbff67f

IAm0x52 commented 1 year ago

Methodology for calculating prices between L1 and L2 implementations are unexpectedly different. Need more clarification/changes before sign off