Vault can experience long downtime periods
The vault's safety check compares the Balancer pool spot price to a Chainlink price that can be up to 24 hours old and deviate by up to 2% from the trusted price. If the threshold is set below 2%, deposits and withdrawals can revert for hours until the oracle updates.
Source: https://github.com/sherlock-audit/2023-02-olympus-judging/issues/210
Found by
Bahurum
Summary
The chainlink price could stay up to 24 hours (heartbeat period) outside the boundaries defined by THRESHOLD but within the chainlink deviation threshold. Deposits and withdrawals will not be possible during this period of time.
Vulnerability Detail
The _isPoolSafe() function checks if the balancer pool spot price is within the boundaries defined by THRESHOLD respect to the last fetched chainlink price.
Since in _valueCollateral() the updateThreshold should be 24 hours (as in the tests), then the OHM derived oracle price could stay at up to 2% from the on-chain trusted price. The value is 2% because in WstethLiquidityVault.sol#L223:
return (amount_ * stethPerWsteth * stethUsd * decimalAdjustment) / (ohmEth * ethUsd * 1e18);
stethPerWsteth is mostly stable and changes in stethUsd and ethUsd will cancel out, so the return value changes will be close to changes in ohmEth, so up to 2% from the on-chain trusted price.
If THRESHOLD < 2%, say 1% as in the tests, then the Chainlink price can deviate by more than 1% from the pool spot price and less than 2% from the on-chain trusted price fro up to 24 h. During this period withdrawals and deposits will revert.
Impact
Withdrawals and deposits can be often unavailable for several hours.
Code Snippet
Tool used
Manual Review
Recommendation
THRESHOLD is not fixed and can be changed by the admin, meaning that it can take different values over time.Only a tight range of values around 2% should be allowed to avoid the scenario above.
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 threshold for acceptable price deviation is set lower than the maximum possible deviation of the Chainlink oracle between updates, causing the safety check to fail during normal oracle lag.
Impact
Deposits and withdrawals could be unavailable for several hours at a time.
What the attacker needed
Admin sets THRESHOLD below 2%; Chainlink price lags within deviation
The fix
The threshold should be restricted to a tight range around 2% to prevent the oracle lag from blocking deposits and withdrawals.
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 vault uses two price sources: a live pool price and a slower oracle price. If they differ too much, the vault blocks deposits and withdrawals. Because the oracle can lag and drift, a tight safety limit can cause the vault to lock users out for hours.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.