Stratax makes an unconstrained low-level .call() to oneInchRouter in the middle of the Aave flash loan callback executeOperation. At the time of this call, Aave debt is already outstanding and the flash loan repayment approval has not yet been set.
The contract inherits no ReentrancyGuard. A malicious 1inch router or an ERC-777 token hook can re-enter createLeveragedPosition or unwindPosition before the first execution completes, finding the contract in a half-finished state with inconsistent balances and approvals.
Likelihood:
Any ERC-777 token used as borrowToken triggers hooks on transfer/transferFrom, providing a re-entry point without any router involvement
A malicious or compromised oneInchRouter can call back into createLeveragedPosition within the same execution frame
Impact:
Re-entrant calls find the contract with borrowed tokens present but the repayment approval not yet set, allowing double-borrowing against the same collateral
The balance invariant check afterSwapBorrowTokenbalance == prevBorrowTokenBalance can be bypassed if a re-entrant call moves tokens before the check executes
A malicious 1inch router re-enters createLeveragedPosition during the swap call. The second call initiates a second flash loan while the first is still executing.
The CEI (Checks-Effects-Interactions) violation is confirmed by code order: the external call to oneInchRouter at line 514 precedes the repayment approval at line 534 and the balance checks at lines 517-518.
Inherit ReentrancyGuardUpgradeable and apply nonReentrant to all state-changing entry points. Additionally, move the flash loan repayment approval before the external swap call.
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.
The contest is complete and the rewards are being distributed.