This repository contains the full exploit code for the "Magic Animal Carousel" challenge from Ethernaut, developed to demonstrate a high-level vulnerability chain involving:
- Precise buffer overflow via bit overflow
- Destructive XOR data corruption
- Infinite loop creation through circular crate references
- Invariant violation in storage layout (bit-packing mismanagement)
The exploit is written in Solidity (v0.8.28) and can be run in Remix or integrated into a Foundry/Hardhat environment.
If you're interested in the complete breakdown of the vulnerability chain, exploitation steps, and reflections on AI-assisted auditing, check out the article below:
- π¬π§ English: https://www.cyphertux.net/articles/en/research/magic-carousel-exploit
- π«π· FranΓ§ais : https://www.cyphertux.net/articles/fr/research/magic-carousel-exploit
This challenge was solved in under 5 minutes after a prior failed attempt β thanks to a powerful AI model now capable of understanding and exploiting subtle smart contract logic.
MagicCarouselExploit.sol
β Full Solidity exploitIMagicAnimalCarousel.sol
β Minimal interface to interact with the target challenge
MIT