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

Potential deployments to L2 networks, should check for active sequencer on Chainlink price feeds

Summary

As mentioned in the protocol's README, and based on the the Temp-Check-5 proposal, it's quite likely a migration to EVM compatible L2 networks will happen. However if the community proposes, through the Beanstalk governance a migration to chains like Arbitrum/Optimism, the retrieved prices from price feeds might be incorrectly perceived as fresh.

Vulnerability Details

As of right now protocol's current usage of Chainlink price feeds, only has a mechanism which returns 0 in case the call to Chainlink aggregator reverts in LibChainlinkOracle::getPrice:

function getPrice(
address priceAggregatorAddress,
uint256 maxTimeout
) internal view returns (uint256 price) {
IChainlinkAggregator priceAggregator = IChainlinkAggregator(priceAggregatorAddress);
// First, try to get current decimal precision:
uint8 decimals;
try priceAggregator.decimals() returns (uint8 _decimals) {
// If call to Chainlink succeeds, record the current decimal precision
decimals = _decimals;
} catch {
// If call to Chainlink aggregator reverts, return a price of 0 indicating failure
return 0;
}

However it doesn't consider whether the sequencer is down for deployments on L2 blockchains. It's important to ensure that the prices provided are not falsely perceived as fresh, even when the sequencer is down. It should be always checked before consuming any data from Chainlink.

Impact

A call to Chainlink is made, but the sequencer is down, and this results in returned prices falsely perceived as fresh.

  • Impact: Medium, as it might return incorrect prices, which might not be in favor of the protocol

  • Likelihood: Low, as it requires an accepted proposal by the Beanstalk DAO, and the sequencer must go down

  • Overall: I consider this as a Low severity because of: Medium (the impact) / Low (the potential proposal) / Low (sequencer down)

Tools Used

Manual Review

Recommendations

Implement functionality to check the sequencer uptime with Chainlink oracles for deploying to L2s.

Reference here: https://docs.chain.link/data-feeds/l2-sequencer-feeds#example-code

Updates

Lead Judging Commences

inallhonesty Lead Judge 12 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.