LW Hack
What happened
On May 12, 2023 (UTC), an attacker used a flash loan to drain about $48,000-$50,000 in USDT from LW, a BEP-20 token trading on PancakeSwap. The attack abused LW's automatic buyback: a wallet named marketAddr in the token's logic, holding about 173,272 USDT, was used to buy LW and push its price up, and the attacker could trigger those buybacks at will.
The attacker borrowed 1,000,000 USDT, bought LW, repeatedly forced the buyback wallet to buy LW at rising prices, then sold their LW back for USDT, repaid the loan and kept the difference. PeckShield, MetaTrust, Hexagate and others flagged the attack, and the LW price fell by roughly 69-80%. About 150 BNB of the proceeds was sent through Tornado Cash, and no funds were recovered.
Attacker: 0x4404de29913e0fd055190e680771a016777973e5
Attack contract: 0xa4fbc2c95ac4240277313bf3f810c54309dfcd6c
Attack transaction: 0xb846f3aeb9b3027fe138b23bbf41901c155bd6d4b24f08d6b83bd37a975e4e4a
How it happened
- The attacker flash-borrowed 1,000,000 USDT from a PancakeSwap pair and swapped it for LW.
- In a loop, the attack contract sent LW to the LW/USDT pool, called
skim()to pull the excess back, and sent 1 wei of BNB to the LW token contract. That payment ran the contract's buyback, which spent 3,000 USDT frommarketAddrto buy LW and push the price up. - The loop repeated while
marketAddrstill held more than 3,000 USDT, so the buyback wallet kept buying LW at ever higher prices. - The attacker swapped all their LW back to USDT at the inflated price, repaid the flash loan with its fee, and kept about $48,000-$50,000.
- The proceeds were converted and about 150 BNB was moved through Tornado Cash.
Protocol details
Evidence
- report @DeDotFiSecurity incident report twitter.com
- transaction bscscan.com transaction 0x4617…3a97 bscscan.com
- transaction bscscan.com transaction 0xb846…4e4a bscscan.com
- address bscscan.com address 0x4404…73e5 bscscan.com
- address bscscan.com address a4fbc2…cd6c bscscan.com
- code DeFiHackLabs LW_exp.sol (2023-05) and 2023 README entry github.com
- analysis DeFiLlama defillama.com
- analysis LW Token Price Manipulation Attack quadrigainitiative.com
Understand the attack patterns
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.