The Stratax contract integrates with the 1inch aggregation router to perform token swaps during leveraged position creation and unwinding. The _call1InchSwap function is used to execute swaps by forwarding arbitrary calldata to the router via a low-level .call(). Before this call, the contract approves the full borrow/collateral amount to the oneInchRouter address.
The _oneInchSwapData parameter passed to createLeveragedPosition and unwindPosition is directly forwarded to the 1inch router without any validation of its contents. Since the router contract exposes multiple functions beyond just swapping (including functions that can transfer tokens to arbitrary destinations), a malicious or compromised owner could craft calldata that redirects the approved tokens to an attacker address instead of performing a legitimate swap.
Likelihood:
The owner is the sole caller of createLeveragedPosition and unwindPosition, and they supply the _oneInchSwapData parameter directly. No on-chain validation occurs on the calldata structure, function selector, or destination address encoded within it.
The 1inch aggregation router inherently supports multiple function signatures beyond swap(), including functions that can route tokens to arbitrary receivers. The contract approves the full token amount before the .call() is executed.
Impact:
All tokens approved to the 1inch router (up to the full borrow or collateral amount) can be redirected to any address, resulting in complete loss of the position's funds.
When the result is empty (the else branch), the return amount is determined by the contract's balance of _asset, which can be manipulated if the calldata performs an unexpected operation that does not return tokens but the contract already holds a balance of that asset.
The following shows how _executeOpenOperation approves the full borrowAmount to the 1inch router and then passes user-controlled oneInchSwapData directly into a low-level .call(). Because no function selector or destination whitelist is enforced, the caller can encode any router function — including those that transfer the approved tokens to an arbitrary receiver rather than swapping them back to the contract.
Restrict the allowed function selectors to known safe 1inch swap functions (swap, unoswap) and replace the return-value decoding with a balance-delta check. This eliminates both the arbitrary-call vector and the unreliable else branch that falls back to balanceOf.
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.