The StrategyArb contract contains an incorrect slippage validation implementation within the _swapUnderlyingToAsset function. The current slippage validation relies solely on the minOut parameter passed by the caller. This approach allows an attacker to set an unreasonably low minOut value, enabling swaps at unfavorable prices and potentially causing significant losses for the protocol.
Caller-Defined minOut: The minOut parameter, which determines the minimum acceptable output tokens, is supplied by the caller and lacks verification against price oracles.
No Price Oracle Integration: There is no mechanism to validate the swap rate (e.g., using a price oracle) to ensure that the swap occurs at a fair price.
A malicious keeper calls the claimAndSwap function with a deliberately low minOut value.
The _swapUnderlyingToAsset function approves the transaction as long as the minOut is marginally greater than _amount, bypassing slippage protection.
The attacker routes the swap through unfavorable paths, causing a significant loss in the value of tokens received compared to the underlying tokens sent.
Mqnual Review
Price Oracle Validation
Use a reliable price oracle (e.g., Chainlink) to fetch the current market price of underlying and asset. Compare the swap rate with the oracle price and ensure it does not exceed a predefined slippage tolerance. Example:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.