57983 sc low direct asset drain via zeroxswapverifier bypass and mytstrategy unlimited permit2 approvals
Submitted on Oct 29th 2025 at 19:28:39 UTC by @rshackin for Audit Comp | Alchemix V3
Report ID: #57983
Report Type: Smart Contract
Report severity: Low
Target: https://github.com/alchemix-finance/v3-poc/blob/immunefi_audit/src/utils/ZeroXSwapVerifier.sol
Impacts:
Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
Protocol insolvency
Description
Summary:
The ZeroXSwapVerifier library fails to enforce critical calldata fields (recipient, buyToken, minAmountOut, from, to) when validating 0x Settler EXECUTE payloads, allowing malicious routes that redirect funds to arbitrary recipients to pass verification. Combined with MYTStrategy's unlimited, owner-configurable Permit2 approvals on the receipt token, this enables direct theft of strategy custodied assets via crafted calldata that "verifies" but transfers tokens from the strategy to an attacker under the standing allowance.
When combined with MYTStrategy's unlimited, owner-configurable Permit2 approvals on custody tokens, this enables direct theft of all strategy-held MYT collateral and causes protocol-wide insolvency by creating unfulfillable transmuter redemption obligations.
Vulnerability Details
Root Cause 1:
ZeroXSwapVerifierDoes Not Bind Recipients or Amounts. Functions:verifySwapCalldata,_verifyExecuteCalldata,_verifyTransferFrom.
Issue 1.1: The
_verifyExecuteCalldatafunction decodes theSlippageAndActionsstruct containingrecipient,buyToken, andminAmountOut, but never validates these fields:
Issue 1.2: The
_verifyTransferFrombranch decodes (address token,address from,address to,uint256 amount) but only requirestoken == targetToken, completely ignoringfromandto:
Issue 1.3: The owner parameter is passed through the call chain but never enforced in any action validation path, so unauthorized spenders and recipients are not detected.
Consequence: An attacker can craft EXECUTE calldata with TRANSFER_FROM(receiptToken, strategy, attacker, drainAmount) that passes verification despite explicitly draining the strategy to an external address.
Root Cause 2:
MYTStrategyUnlimitedPermit2Approvals. Functions:constructor,setPermit2Address. Issue: Both theconstructorandadminsetter grant unlimited approval on the receipt token to a configurable Permit2 address:
Consequence: Once Permit2 (or any configured address standing in for it) is set, the standing allowance enables anyone holding "verified" calldata to trigger transferFrom(strategy, attacker, amount) under that approval, with no per-transaction authorization required from the strategy.
Combined Attack Path:
Prerequisites:
MYTStrategyhas been deployed with aPermit2address(normal operation).Strategy holds receipt tokens in custody (vault shares or similar in-scope assets). Attack Steps:
Attacker crafts
0x SettlerEXECUTEpayload:
Verification passes:
Settlement executes drain:
Result: Receipt tokens move from strategy custody to attacker, with no enforcement of recipient/owner at any boundary in these contracts.
Attacker repeats Steps 1-3 for every deployed
MYTStrategy.
Impact :
Direct theft of user funds: All MYT tokens held in strategy custody. (Assets at Risk):
Primary: All MYT (receipt tokens) held in MYTStrategy custody
Scale: 100% of strategy balances across all deployed strategies.
Irreversibility: Tokens transferred to attacker's EOA; no built-in recovery mechanism.
Protocol insolvency: Permanent deficit between liabilities (earmarked debt, pending redemptions) and available assets, rendering transmuter claims unfulfillable and locking user withdrawals indefinitely.
References:
(https://github.com/alchemix-finance/v3-poc/blob/immunefi_audit/src/utils/ZeroXSwapVerifier.sol#L99-L130)
Recommended Mitigation:
Enforce
SlippageAndActionsFields in Verifier:
Bind from/to in
TRANSFER_FROM:
Scope Permit2 Approvals in Strategy:
Proof of Concept
Proof of Concept:
Results:
Was this helpful?