This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
ss3434 - _etherPrice() in Kept.sol missing checking sequencer status on L2 #25
Labels
Non-Reward
This issue will not receive a payout
ss3434
medium
_etherPrice() in Kept.sol missing checking sequencer status on L2
Summary
Using Chainlink in L2 chains such as Arbitrum requires to check if the sequencer is down to avoid prices from looking like they are fresh although they are not.
Vulnerability Detail
modifier keep
uses_etherPrice()
for calculationkeeperFee
.The _etherPrice() function is a function in the Kept.sol contract that fetches the latest price data from a Chainlink price feed.
Also it's missing checking sequencer status on L2.
From Chainlink documentation:
Optimistic rollup protocols have a sequencer that executes and rolls up the L2 transactions by batching multiple transactions into a single transaction.
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.
This means that if the project does not check if the sequencer is down, it can return stale results.
Impact
Posible wrong calculation
keeperFee
inmodifier keep
Code Snippet
https://github.com/sherlock-audit/2023-07-perennial/blob/main/root/contracts/attribute/Kept.sol#L40C3-L57C6
https://github.com/sherlock-audit/2023-07-perennial/blob/main/root/contracts/attribute/Kept.sol#L61-L64
Tool used
Manual Review
Recommendation
Check L2 sequencer status and data staleness by time interval.
From Chainlink documentation:
Duplicate of #146
The text was updated successfully, but these errors were encountered: