Open sherlock-admin opened 1 year ago
This is kind of similar to #029 in terms of underlying cause (knowledge of oracle update price)
Fix Implementation: https://github.com/0xLienid/sherlock-olympus/pull/3/files
Fix looks good. Contract now enforces delay between deposit and withdrawal
0x52
high
Adversary can sandwich oracle updates to exploit vault
Summary
BLVaultLido added a mechanism to siphon off all wstETH obtained from mismatched pool and oracle prices. This was implemented to fix the problem that the vault could be manipulated to the attackers gain. This mitigation however does not fully address the issue and the same issue is still exploitable by sandwiching oracle update.
Vulnerability Detail
BLVaultLido.sol#L232-L240
In the above lines we can see that the current oracle price is used to calculate the expected amount of wstETH to return to the user. In theory this should prevent the attack but an attacker can side step this sandwiching the oracle update.
Example:
The POC is very similar to before except now it's composed of two transactions sandwiching the oracle update. Chainlink oracles have a tolerance threshold of 0.5% before updating so we will use that as our example value. The current price is assumed to be 0.995 wstETH/OHM. The oracle price (which is about to be updated) is currently 1:1
As shown above it's still profitable to exploit the vault by sandwiching the oracle updates. With each oracle update the pool can be repeatedly attacked causing large losses.
Impact
Vault will be attacked repeatedly for large losses
Code Snippet
https://github.com/sherlock-audit/2023-03-olympus/blob/main/sherlock-olympus/src/policies/BoostedLiquidity/BLVaultLido.sol#L203-L256
Tool used
Manual Review
Recommendation
To prevent this I would recommend locking the user into the vault for some minimum amount of time (i.e. 24 hours)