Baby Doge Coin Hack

Reported loss $100K
Flash Loan Attack

What happened

On June 21, 2023, an attacker drained about 442 BNB (roughly $100,000) through the BabyDoge Coin token on BNB Smart Chain. BabyDoge charges a fee on transfers and periodically sells its own accumulated tokens for BNB to add liquidity. A third-party contract had been excluded from those fees, so the attacker could move large BabyDoge amounts for free and sandwich the token's automatic liquidity sale, which had no effective slippage protection.

Hexagate said it had flagged the attack contract on June 12, nine days before it was used, and Cyvers reported the attacker was funded through Tornado Cash. CertiK, which audited BabyDoge in 2021, said the issue fell outside that audit's scope.

How it happened

  1. The attacker took a flash loan of USDT and BUSD from a PancakeSwap V3 pool, supplied it to Venus and borrowed BNB against it.
  2. Using a router contract that BabyDoge had excluded from its transfer fee, the attacker bought BabyDoge and moved tokens into the PancakeSwap BabyDoge/WBNB pair without paying the fee, selling them to push the BabyDoge price down.
  3. The attacker then topped up the token contract's own balance to its numTokensSellToAddToLiquidity threshold and made a transfer that triggered BabyDoge's automatic sell-and-add-liquidity routine, which dumped the contract's tokens into the depressed pool with no minimum-output check.
  4. The attacker bought BabyDoge back cheaply, moved it fee-free to the pair on BabyDoge's own router and sold it there for WBNB.
  5. After repaying Venus and the flash loan, the attacker kept about 441-442 BNB.

Protocol details

Classification Token
Protocol Type Exploit/Flash Loan Attack
Affected asset / contract BabyDoge
Protocol links Website @BabyDogeCoin

Understand the attack patterns

Build your security review skills

Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.