Crypto exploits

PancakeV3SwapHelper exploit analysis

An unverified USDT-to-BNB swap helper on BNB Chain treated Pancake V3's positive input delta as a BNB output and unwrapped that amount from its own inventory, paying 1.651021 BNB for a swap that returned 0.002089 WBNB. DeFiHackLabs records about 1.6488688845 BNB drained.

David

Security ·

Reported loss
$1K
Occurred
Logged
Chain
BNB Chain

Logged as “2026-09-23: Signed Swap Delta Accounting Error on PancakeV3SwapHelper”.

Analysis3 min read

An unverified swap helper on BNB Chain that converts USDT to BNB paid out 1.651021 BNB for a swap that returned 0.002089 WBNB. The difference came from the helper's own inventory, and the attacker left with 1.6488688845 BNB, about $1.30K. The whole attack ran inside the constructor of a contract that did not exist before the transaction that exploited it. DeFiHackLabs records the incident and ships a proof of concept. The ExVul alert that flagged it names the entry point as swapTokenForBNBWithRecipient().

Reading a delta as an amount

Pancake V3 reports what a swap did as two signed values. On a USDT to WBNB swap the input is positive and the output is negative, which is the ordinary way of saying the pool took one asset and gave the other. The helper takes the positive figure, which is denominated in USDT, and uses it as the quantity of WBNB to unwrap and pay out.

The two numbers are not close here. The pool returned 0.002089397784051482 WBNB. The helper held 1.651021225164017256 WBNB, and the attacker set amountIn to exactly that balance, so the misread delta matched the helper's entire inventory. The helper paid it all out, unwrapped from its own balance, to the address the caller nominated as recipient.

The missing check is that the figure being used as an output has to come from the output side of the swap. Treating a signed input delta as an amount to spend is a unit error rather than a logic error, and it fails silently: the helper has inventory, so a wildly wrong payment still succeeds.

The ExVul alert describes that inventory as WBNB previously trapped in the helper, and notes that the helper is immutable, so any WBNB sent to it afterwards is drainable the same way.

The sequence

  1. Borrow 3.651021225164017256 USDT from Moolah at zero fee: 1.651021225164017256 for the vulnerable call and a 2 USDT buffer for repayment.
  2. Call the helper with USDT on Pancake V3's 0.01% fee tier, amountIn of 1.651021225164017256, and the attack contract as recipient. The pool returns about 0.002089 WBNB and the helper pays 1.651021225164017256 BNB from inventory.
  3. Wrap 0.05 BNB, then buy exactly 1.651021225164017256 USDT through Pancake V2. That swap spends 0.002095724137859296 WBNB.
  4. Unwrap the remainder and repay the Moolah principal in full.
  5. Send the leftover 1.648925501026157960 BNB to the attacker.

Step 3 is what makes the attack cheap rather than merely large. The cost of buying back the USDT the helper was supposed to have consumed is 0.002096 WBNB. The attacker spends about 0.0021 WBNB to receive a BNB payout roughly 790 times larger, and the flash lender is made whole before the transaction ends.

The result

DeFiHackLabs records a loss of about 1.6488688845 BNB, some $1.3K, which is the pre-gas profit less the transaction fee. The arithmetic checks out: 1.648925501026157960 BNB of profit before gas, less 1,132,330 gas at 0.05 gwei, gives the reported figure.

The chain agrees on the shape of the attack as well as the amount. The attack transaction 0x70bc4ff8439f74d26d454a53e9a135ac3659a958aa3462218d0db7ed55cf5104 at block 123,534,292 has no recipient address, which means it created a contract, and it consumed exactly 1,132,330 gas, matching the figure in the entry. The entire exploit ran as constructor logic.

The helper is unverified, and its source has never been published. The proof of concept infers the root cause from the helper's runtime behaviour and the attack trace, and the ExVul alert gives the same account of the misread delta.

Where the guard was missing

A signed delta needs to be resolved against the side of the swap it came from before it is used as an amount. Paying out the WBNB side, the amount the pool actually returned, would have capped this payout at 0.002089 WBNB.

Sources read (4)

Other exploits

Query every incident yourself — free, no signup

Updated 22 Nov 2026. Figures are as reported by the sources listed above and are not independently verified.