DeFiHardhatFoundry
250,000 USDC
View results
Submission Details
Severity: medium
Invalid

No checks if the L2 sequencer is active

Github link

https://github.com/Cyfrin/2024-05-beanstalk-the-finale/blob/9c7b9fd521ad7cbe65cc788df181887c0eb39c6d/protocol/contracts/libraries/Oracle/LibChainlinkOracle.sol#L71

https://github.com/Cyfrin/2024-05-beanstalk-the-finale/blob/9c7b9fd521ad7cbe65cc788df181887c0eb39c6d/protocol/contracts/libraries/Oracle/LibChainlinkOracle.sol#L113

Summary

Chainlink recommends that users using price oracles, check whether the L2 Sequencer is active.

Vulnerability Details

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

File: LibChainlinkOracle.sol
70: // Secondly, try to get latest price data:
71: try priceAggregator.latestRoundData() returns (
72: uint80 roundId,
73: int256 answer,
74: uint256 /* startedAt */,
75: uint256 timestamp,
76: uint80 /* answeredInRound */)
...
113: try priceAggregator.latestRoundData() returns (
114: uint80 roundId,
115: int256 answer,
116: uint256 /* startedAt */,
117: uint256 timestamp,
118: uint80 /* answeredInRound */)

So the above functions might return incorrect prices.

Impact

The protocol might use a stale price from Chainlink oracles.

Tools Used

Manual Review

Recommendations

Use a chainlink oracle to determine whether the sequencer is offline or not.

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Known issue
Assigned finding tags:

L2 Sequencer check

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.