The StrategyOp contract contains a critical vulnerability in its withdrawal mechanism that leaves user funds at risk of becoming locked in the contract. At the core of this issue lies a fundamental misunderstanding of the transmuter's token exchange protocol within the _freeFunds function.
The transmuter system operates on a two-phase withdrawal architecture where synthetic tokens must first undergo an exchange process before they can be withdrawn. However, the current implementation completely circumvents this crucial exchange step, instead attempting to withdraw tokens directly from their unexchanged state - an operation that will fail at the protocol level.
The severity of this vulnerability cannot be understated, as it effectively renders the entire withdrawal mechanism non-functional, creating a situation where user funds become inaccessible until the underlying issue is resolved.
Examining the current implementation reveals the architectural flaw:
https://github.com/Cyfrin/2024-12-alchemix/blob/main/src/StrategyOp.sol#L125
The transmuter interface exposes the exchange functionality that's being bypassed:
When a user initiates a withdrawal, their tokens exist in an unexchanged state within the transmuter. The current implementation attempts to withdraw these tokens directly, triggering a revert as the transmuter's protocol requires tokens to be exchanged before withdrawal. This creates a deadlock where funds remain trapped in their unexchanged state with no viable withdrawal path.
The vulnerability requires a fundamental redesign of the _freeFunds function to properly integrate with the transmuter's exchange mechanism:
This redesigned implementation aligns with the transmuter's protocol requirements by first assessing the available exchanged balance, performing any necessary token exchanges, and only then proceeding with withdrawals. The addition of proper balance validation prevents attempted withdrawals of unavailable funds, while maintaining protocol integrity.
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.