Resources

People often ask me "How did you learn how to hack?" The answer: by reading. This page is a collection of the blog posts and other articles that I have accumulated over the years of my journey. Enjoy!

The Transmuter's Over-Burn- 2166

TrustSecPosted 25 Days Ago
  • Alchemix's MYT (Meta Yield Token) vaults are ERC-4626-style vaults with pluggable strategies. The ETH MYT vault kept part of its backing in TokeAutoETH from Tokemak. There is a whole nesting of products here that makes this super duper complicated to grasp.
  • On Alchemix, forceDeallocate() can be used to force deallocate the strategy but pay a fee of 2% of the funds. When exiting the vault, it will convert to shares and then use a live AMM to swap the token for WETH with zero minimums.
  • The problem is that nothing in Alchemix or Tokemak bound what the forced exit was allowed to lose. The trigger let any LP choose when and how much value went through. The destination swaps used minBuyAmount=0 and the integration only checked that the requested WETH arrived, never what was burned to produce it.
  • Here is how the exploit worked:
    1. Wait for Alchemix to deposit WTH into the Tokemark authETH strategy.
    2. Buy just enough MYT shares to cover the 2% penalty.
    3. Flash-borrow wstETH from Aave to sell it into the route that Tokemark will use. The goal is to make authETH more expensive than the WETH terms.
    4. Call forceDeallocate() with nice attacker parameters on Tokemak. This pulls liquidity out of the state and gives the Alchemix strategy less funds than expected. This is the frontrunning process for manipulating the AMM.
    5. Tokemak exits the queue head into the wrecked route. Alchemix gets less WETH, and the call succeeds.
    6. Back-run the AMM route to profit. The value NOT given to Alchemix is now given to you.
    7. Swap back to wstETH, repay the flash loan, and keep the rest.
  • The missing slippage protection was actually noticed on an Immunefi competition. I don't fully understand the flow of manipulation but I do get the general concept: exit strategy in tokemak reduces the amount of funds that Alchemix can get. These can be recovered through some means to profit.
  • They found this bug with some help from AI assistance. The clanker noticed the forced exit and small penalties on Tokemak, and the deallocation loop. From there, they turned these small findings into a real attack path. Eventually, they realized it was possible to make a forced exit be lossy and unwind the profit. The bug is cool but the article was hard for me to follow without clear distinctions on entities.