Crypto exploits

YSDAO exploit analysis

A flash loan let an attacker fake a liquidity removal and a liquidity addition on YSDAO's PancakeSwap pair, skipping the token's buy fee and size cap going in and its sell cooldown, size cap and profit-based fee going out, for a reported profit of about 19,490.9 USDT. The token's verified source and BNB Smart Chain's own record of the transaction confirm the mechanism and the date independently of DeFiHackLabs' reconstruction.

David

Security ·

Reported loss
~19.49K USDT (19,490.907296125583506343 USDT exactly), per DeFiHackLabs' reconstruction; no source states a figure in USD specifically, so no lossUsd figure is given
Occurred
Logged
Chain
BNB Smart Chain

Logged as “2026-05-29: Price Manipulation And Tax Bypass on YSDAO”.

Analysis3 min read

YSDAO's token contract carries BSC's familiar anti-bot shape: a transfer hook that tries to tell a normal buy or sell apart from someone adding or removing liquidity on the YSDAO/USDT PancakeSwap V2 pair, so it can tax the two differently. The token's verified source on Sourcify shows the two checks in full. _isAddLiquidity() reads the pair's live USDT balance and returns true when that balance is at least the cached reserve plus 1 ether; _isRemoveLiquidity() returns true whenever the cached reserve is greater than the live balance. Both compare a balance snapshot against a reserve snapshot, never who called what or whether a mint or burn actually happened, which is the gap the attack worked through.

The two branches matter because of what each one skips, and the verified _transfer override is specific about it. A normal buy, routed through the pair, records the buyer's USDT cost in tOwnedU, starts a cooldown, takes a 3% fee, and rejects any single buy larger than a tenth of the pair's YSDAO reserve. The remove-liquidity branch does none of that: it calls super._transfer directly, with no fee and no size cap. On May 29, 2026, an attacker reached that branch without removing any liquidity. Inside a single transaction, borrowing 8,000,002 USDT in a flash loan from a PancakeSwap V3 USDT/WBNB pool, the attacker called swap directly on the YSDAO/USDT pair and took the USDT side of the trade as 1 wei of output rather than the amount a router call would compute, so the pair's USDT balance fell a wei below its cached reserve. That was enough to make _isRemoveLiquidity() read true for the transfer that followed, letting the attacker take roughly 8,000,000 USDT worth of YSDAO out of the pair with no 3% fee and without tripping the 10% buy cap that would otherwise have rejected a trade of that size.

Before selling, the attacker called sync() on YSDAO's separate Staking contract, a function the proof of concept describes as open to any caller, which forwards every USDT token the staking contract holds into the YSDAO/USDT pair and then calls the pair's own sync(), resetting the pair's cached reserves to match its new, USDT-heavier balance. The Staking contract's source has not been published, so its sync() implementation cannot be confirmed directly; this step rests on the proof of concept alone. The attacker then transferred 1 USDT into the pair, pushing its live balance back above the freshly reset reserve and making _isAddLiquidity() read true for the sale that followed. That branch's own code shows what it buys the attacker on the way out: a flat 3% fee, with none of the normal sell path's cooldown check, 10% size cap, or the extra profit-based fee of up to 25% that applies once a seller's tracked tOwnedU cost is exceeded. The attacker sold the full YSDAO balance back to USDT through PancakeSwap's router and repaid the flash loan.

BNB Smart Chain's own record confirms the transaction independently of DeFiHackLabs' writeup. Transaction 0x91f26d96373bbec6a6a8517c7be995a739d65f20fed589d53bc47d8140f91907 sits in block 101,088,361, one block after the proof of concept's fork point, timestamped May 29, 2026, 09:12:43 UTC. The transaction's sender matches the proof of concept's attacker address and its recipient matches the attack contract address; its call data encodes the V3 pool's address alongside an amount of exactly 8,000,002 USDT, matching the proof of concept's flash-loan constant to the wei. The Transfer-log amounts have not been cross-checked independently of the proof of concept, and no entry for YSDAO or this date appears in DeFiLlama's hacks database, which does not appear to track losses this small.

DeFiHackLabs' reconstruction, run against the live chain state at the attack's block, puts the net profit at 19,490.907296125583506343 USDT. No write-up from a security firm or news outlet covering this specific incident was found, so the loss figure and the staking-contract step rest on that reconstruction, while the mechanism's two balance checks, the buy and sell branch logic, and the transaction's date and parties are confirmed independently through the token's verified source on Sourcify and the chain's own record of the transaction.

The technique is not unique to YSDAO on this site. Reserve/balance desynchronization via a premature pair sync() also recurs in FHToken and CashCowCoin, but through a different mechanism. In FHToken, _transfer removes FH from the pool and calls sync() before crediting the sell. In CashCowCoin, a public sell() triggers a privileged burn out of the pair followed by sync(). Neither spoofs a liquidity-add or liquidity-remove check as in YSDAO. A sync() restricted to the pair contract's own logic, rather than callable by anyone holding a reference to the staking contract, and a liquidity check that verified an actual mint or burn event rather than a balance snapshot, would have closed the path this attacker used.

Sources read (7)

Other exploits

Query every incident yourself — free, no signup

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