A critical vulnerability exists in the runNextAction function due to improper synchronization of state variables during multi-step operations. This allows attackers to manipulate residual swap/withdrawal progress data, leading to double-spending of vault funds. The root cause is the failure to fully reset swapProgressData and flowData states between asynchronous operations.
The runNextAction function handles complex workflows involving GMX positions and DEX swaps. Critical state variables like swapProgressData track partial swap executions, while flowData stores context for ongoing operations. These states are not atomically updated across GMX callbacks and swap operations.
Incomplete state reset in swap handling:
Partial swap states enable reuse across unrelated operations
Residual flowData allows cross-user fund contamination
No isolation between deposit/withdrawal contexts
Manual Code Review
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.