Severity: Low
Files Affected
cadence/contracts/FlowALPv1.cdc
Description
In the manualLiquidation() function, the DEX quote is fetched and compared in the same transaction. A sandwich attack can be executed where:
- Front-run: Manipulate DEX pool to worsen its price.
- Liquidation executes: DEX quote is artificially bad, so the liquidator's offer appears "better than DEX".
- Back-run: Reverse manipulation for profit.
Recommendation
Use TWAP instead of spot quote, or use oracle price as the primary benchmark.
Parent Issue: #209