Stratax::_call1InchSwap balanceOf fallback can bypass minReturnAmount slippage protectionWhen 1inch returns no data from a swap, Stratax::_call1InchSwap falls back to using the contract's entire token balance as the returnAmount:
The returnAmount here does not ONLY represent the tokens received from the swap — it includes any pre-existing balance of _asset already sitting in the contract. This directly defeats the minReturnAmount slippage protection: a swap could return far less than expected, but as long as the contract's prior balance of _asset, plus what was actually returned from the swap exceeds _minReturnAmount, the check passes silently.
Two ways tokens can accumulate in the contract to enable this:
Excess collateral from unwinds: Stratax::_executeUnwindOperation currently withdraws more collateral from Aave than the 1inch swap consumes due to the mismatched collateralToWithdraw calculations. The surplus sits in the contract.
Direct transfers: Anyone can send tokens directly to the contract address. There is no mechanism to prevent this, and these tokens would be absorbed into the balanceOf reading.
Beyond the slippage bypass, the inflated returnAmount also propagates downstream in both _executeOpenOperation and _executeUnwindOperation:
Likelihood:
Stratax::_executeUnwindOperation routinely withdraws more collateral from Aave than the 1inch swap consumes, so excess tokens accumulating in the contract is the expected state after any unwind — not an edge case.
Additionally, anyone can send tokens directly to the contract at any time.
This triggers when 1inch returns empty result data, which depends on the specific swap function called.
Impact:
The minReturnAmount slippage protection is completely bypassed — a swap executed at an unfavourable rate passes the check as long as the contract holds a sufficient pre-existing balance.
Pre-existing contract balances are silently swept into Aave positions via the excess supply logic, effectively losing those tokens into the position.
A user opens and unwinds a position — Stratax::_executeUnwindOperation withdraws more collateral than the swap consumes, leaving excess collateral in the contract
The user opens a new position where the 1inch swap returns no data
Stratax::_call1InchSwap falls back to balanceOf, which now includes the accumulated USDC
The inflated returnAmount passes the minReturnAmount slippage check despite the swap returning insufficient tokens
Snapshot the balance before the swap and use the delta as the returnAmount:
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.