xWin Finance Hack

Reported loss $270K
BNB Chain
Flash-loan reward exploit

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.

Technical root cause

Invalid slippage control in xWinFund::_swapBNBToTokens

How it happened

  1. The attacker borrowed BNB through a Fortube flash loan.
  2. They swapped and supplied liquidity through the PancakeSwap V1 BNB/xWIN pool, exploiting xWin's invalid slippage control to receive extra rewards.
  3. They unwound the liquidity position and repeated the cycle to accumulate xWIN.
  4. The reward tokens were sold through PancakeSwap V2, and the flash loan was repaid.

Protocol details

Classification Yield Aggregator / Input Validation
Protocol Type Indexes
Affected asset / contract XWIN
Implementation language Solidity
Protocol links Website @xwinfinance

Security review history

Understand the attack patterns

Build your security review skills

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