https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/StrategyMainnet.sol#L95
https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/StrategyMainnet.sol#L56
Missing swap path validation allows manipulation of token routes, risking trades through malicious paths and leading to poor pricing or financial losses.
The swap logic across strategies lacks checks to ensure valid routing paths. There's no verification of intermidary tokens, proper connections between hops, or legitimacy of intermediary tokens. Furthermore, no restrictions exist on path length. Here's how claimAndSwap
function is utilizing those routes (routes[_routeNumber]
):
Here's the codeline to add new routes:
The lack of path validation exposes swaps to potential manipulation, leading to security risks and financial losses.
Manual Review
Consider adding a proper check in addRoute
function.
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.