Any person or MEV bot can frontrun the contract trades and cause a denial of service or at least a non profit tx when the strategy contracts try to get the premium from the DEXes.
The `_swapUnderlyingToAsset` function swaps WETH to ALETH for profit but anyone can simply frontrun and provoke a DOS every single time the contract tries to profit from the DEX, hence blocking the contract's purpose.
https://github.com/Cyfrin/2024-12-alchemix/blob/main/src/StrategyArb.sol#L81-L88
This claimAndSwap
function will check if the trade generated any profits with the require((balAfter - balBefore) >= minOut, "Slippage too high");
_ but since anyone can frontrun this tx (including MEV bots) it will always revert assuming the param_ _minOut
is not 0. A single person can always make sure the strategies are never profitable.
Denial of Service and Frontruning. All 3 contracts in scope have the exact same issue:
https://github.com/Cyfrin/2024-12-alchemix/blob/main/src/StrategyArb.sol
https://github.com/Cyfrin/2024-12-alchemix/blob/main/src/StrategyMainnet.sol
https://github.com/Cyfrin/2024-12-alchemix/blob/main/src/StrategyOp.sol
Manual
This is an intrinsic blockchain problem and prone to these attacks, I think something like Chainlink Functions might work since it would obfuscate the protocols' strategies to some degree.
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.