xWin Finance Hack
What happened
On 25 June 2021, an attacker used flash loans and a flawed slippage check in xWinFund’s _swapBNBToTokens() swap path to repeatedly receive excess xWIN token rewards. PeckShield traced repeated BNB swaps, liquidity deposits and reward claims, and estimated the attacker gained about $270,000. xWIN later closed its referral and reward features while preparing compensation for affected users.
Invalid slippage control in xWinFund::_swapBNBToTokens
How it happened
- The attacker borrowed BNB through a Fortube flash loan.
- They swapped and supplied liquidity through the PancakeSwap V1 BNB/xWIN pool, exploiting xWin's invalid slippage control to receive extra rewards.
- They unwound the liquidity position and repeated the cycle to accumulate xWIN.
- The reward tokens were sold through PancakeSwap V2, and the flash loan was repaid.
Protocol details
Security review history
- CertiK View report
Understand the attack patterns
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.