Carol Protocol Hack
What happened
On 2023-11-30 an attacker drained about 29.92 ETH (roughly $61,164 at the time) from CAROL Protocol, a bond-and-stake token project on Base. The contract priced a user's position from the live balances of the CAROL/WETH pool, and its sell() function sent ETH to the caller in the middle of the calculation. The attacker used flash loans to push the pool price, then re-entered during sell() to shift the pool again before the contract finished its accounting.
Attacker: 0x5AA27D556f898846B9BaD32f0cDba5B1F8bC3144. Attack contract: 0xc4566ae957ad8dde4768bdd28cdc3695e4780b2c. Vulnerable contract: 0x26fe408bbd7a490feb056da8e2d1e007938e5685. Attack transaction: 0xd962d397a7f8b3aadce1622e705b9e33b430e86e0d306d6fb8ccbc5957b4185c. Earlier records listed 0xcDd37Ada79F589c15bD4f8fD2083dc88E34A2af2 as holding the funds on 2023-12-14. DeFiHackLabs estimates the loss at about $53K.
How it happened
- In a preparation transaction the attacker bought a small CAROL bond with about 0.03 ETH and staked it with about 0.039 ETH, opening a position in the protocol.
- About 18 hours later the attack contract took nested flash loans of WETH from Synapse, Balancer, Kokonut and a Uniswap V3 pool, then borrowed more through a V2 flash swap, reaching about 3,400 WETH.
- It swapped all of that WETH into CAROL on BaseSwap. This pushed up the pool price that
userBalance()relies on, inflating the attacker's claimable balance. - It called
sell(). The contract swapped CAROL for ETH withswapExactTokensForETHand sent ETH to the attack contract. Itsreceive()hook re-entered and dumped 90% of its CAROL back into the pool, changing the pool state beforesell()finished its accounting. - The attacker swapped the rest of its CAROL back to WETH, repaid every flash loan, and left with about 29.92 ETH.
Protocol details
Evidence
- report @AnciliaInc incident report twitter.com
- transaction Basescan transaction 0xd962d397...4185c basescan.org
- address basescan.org address 0x5AA2…3144 basescan.org
- address basescan.org address 0xc456…0b2c basescan.org
- address basescan.org address 0xcDd3…2af2 basescan.org
- code DeFiHackLabs 2023 index: 20231130 CAROLProtocol - Price Manipulation Via Reentrancy github.com
- code CAROLProtocol_exp.sol (DeFiHackLabs PoC) github.com
- analysis Web Archive archive.ph
Understand the attack patterns
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.