Skip to content
Audit finding Intermediate

Mainnet oracles are incompatible with wstETH causing many popular yields strategies to be broken

The protocol's oracle adapter only supports single-asset price feeds, but wstETH has no Chainlink or Band oracle on mainnet, leaving only low-liquidity Uniswap pools as a dangerous alternative. This makes many popular yield strategies that rely on wstETH unusable.

0x52 Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2023-07-blueberry-judging/issues/96

Found by

0x52

Mainnet oracles are incompatible with wstETH causing many popular yields strategies to be broken. Chainlink and Band do not have wstETH oracles and using Uniswap LP pairs would be very dangerous given their low liquidity.

Vulnerability Detail

ChainlinkAdapterOracle.sol#L111-L125

    uint256 decimals = registry.decimals(token, USD);
    (
        uint80 roundID,
        int256 answer,
        ,
        uint256 updatedAt,
        uint80 answeredInRound
    ) = registry.latestRoundData(token, USD);
    if (updatedAt < block.timestamp - maxDelayTime)
        revert Errors.PRICE_OUTDATED(token_);
    if (answer <= 0) revert Errors.PRICE_NEGATIVE(token_);
    if (answeredInRound < roundID) revert Errors.PRICE_OUTDATED(token_);

    return
        (answer.toUint256() * Constants.PRICE_PRECISION) / 10 ** decimals;

ChainlinkAdapterOracle only supports single asset price data. This makes it completely incompatible with wstETH because chainlink doesn't have a wstETH oracle on mainnet. Additionally Band protocol doesn't offer a wstETH oracle either. This only leaves Uniswap oracles which are highly dangerous given their low liquidity.

Impact

Mainnet oracles are incompatible with wstETH causing many popular yields strategies to be broken

Code Snippet

ChainlinkAdapterOracle.sol#L102-L126

Tool used

Manual Review

Recommendation

Create a special bypass specifically for wstETH utilizing the stETH oracle and it's current exchange rate.

Discussion

sherlock-admin2

2 comment(s) were left on this issue during the judging contest.

0xyPhilic commented:

invalid because this issue can be considered informational or at best low - tokens used are whitelisted

Kral01 commented:

low severity

IAm0x52

Escalate

This was wrongly excluded. Protocol is meant to be compatible with these pools but can't work with them. I believe this is a valid medium because the protocol is nonfunctional in this area.

sherlock-admin2

Escalate

This was wrongly excluded. Protocol is meant to be compatible with these pools but can't work with them. I believe this is a valid medium because the protocol is nonfunctional in this area.

You've created a valid escalation!

To remove the escalation from consideration: Delete your comment.

You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.

Shogoki

Escalate

This was wrongly excluded. Protocol is meant to be compatible with these pools but can't work with them. I believe this is a valid medium because the protocol is nonfunctional in this area.

Not sure were it says that the protcol is meant to be compatible with WSTETH pools on mainnet.

If that is the case it can be a valid issue, i guess. However if it is not, i think the Whitelisting of tokens would count for invalidating it.

IAm0x52

Protocol is meant to be compatible with Aura/Convex. wstETH is a component of many highly attractive pools. Not being able to support wstETH as an underlying asset will break support for these.

hrishibhat

@Gornutz

Gornutz

Confirm this is valid.

hrishibhat

Result: Medium Unique Considering this issue a valid medium

sherlock-admin2

Escalations have been resolved successfully!

Escalation status:

The original report as published on Sherlock, by 0x52. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the oracle adapter only supports single-asset price feeds and does not derive wstETH's price from stETH and the exchange rate.

What the attacker needed

WstETH used as an underlying asset; no direct wstETH oracle on mainnet

The fix

A special bypass should be created for wstETH that uses the stETH oracle and its current exchange rate.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A price oracle is a service that tells a smart contract how much a token is worth. This protocol's oracle only handles tokens that have a direct price feed, but wstETH (a wrapped staked Ether token) does not have one on mainnet, so the protocol cannot price it safely. As a result, strategies that use wstETH do not work.

More by 0x52

View all

211 more disclosed reports, best first.

More from Blueberry Update #3

View all

The newest disclosed reports for this program.

Similar reports

Same bug class and techniques, clearest first.