Skip to content
Smart contracts Write-up Advanced

Flash Loan Attack Uncovered: PancakeSwap LP Exploit and the DMi/M

An attacker used a flash loan to manipulate the internal reserves of a PancakeSwap liquidity pool through repeated swaps and sync() calls, draining approximately 138.6 WBNB worth about $120,000. The exploit relied on the pair contract allowing reserve manipulation via callbacks without protection.

Evgenii Follow

Published on coinsbench.com

In December 2025, an exploit was performed on BNB, allowing the attacker to withdraw approximately 138.6 WBNBfrom the PancakeSwap liquidity pool for the DMi/WBNB pair, netting approximately $120,000.

Evgenii, on coinsbench.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Impact

The attacker could drain approximately 138.6 WBNB (about $120,000) from the PancakeSwap DMi/WBNB pool.

What the attacker needed

Access to a flash loan provider; a vulnerable PancakeSwap pair; ability to deploy a contract

How it was found

  1. The attacker creates an exploit contract and calls its entry function.
  2. The contract requests a flash loan of about 102,693 WBNB from the Moolah protocol.
  3. In the flash loan callback, the contract checks the DMi token balance of the PancakeSwap pool.
  4. The contract calls swap() to extract both assets from the pair, then returns part of the DMi and calls sync() to set reserves to manipulated values.
  5. The contract sends remaining tokens, performs another swap, and calls sync() again to commit incorrect reserves.
  6. The contract performs a final swap to withdraw the remaining WBNB, calls sync() once more, and repays the flash loan.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A liquidity pool is a smart contract holding two tokens that people trade against; its 'reserves' are the amounts it thinks it holds. The attacker borrowed a huge amount temporarily (a flash loan), then used trades and a function called sync() to make the pool record false reserve amounts, letting them withdraw far more than they put in. This is like tricking a shop's till into thinking it has more money than it does, then taking the difference.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

More by Evgenii

View all

8 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.