Crypto exploits

OceanBPoolSideStaking exploit analysis

Ocean's BPool join and exit math is asymmetric, and SideStaking mirrored every single-sided mOCEAN join or exit with a datatoken stake or unstake, so a flash-funded loop of joins, a gulp call, and exits across eight pools redeemed more mOCEAN than it deposited. DeFiHackLabs reports about 127.86K mOCEAN drained on Polygon.

David

Security ·

Reported loss
127.86K mOCEAN, per DeFiHackLabs; no source states a USD figure
Occurred
Logged
Chain
Polygon

Logged as “2026-06-25: Bpool Single Sided Joinexit Math With Sidestaking Gulp Accounting on OceanBPoolSideStaking”.

Analysis2 min read

Ocean Protocol's BPool is a fork of Balancer V1's weighted pool, used to pair a datatoken against a base asset, in this case mOCEAN, the Polygon-bridged form of Ocean's OCEAN token. Polygonscan shows the BPool implementation behind this incident, at 0xBB3051dF2D3E408DAE6E6dAa2296BC6215F0dCFd, as verified with an exact source match, compiled under Solidity 0.8.12, a fact confirmed directly against the explorer rather than taken from the proof of concept. Ocean's SideStaking contract, at 0x3EFDD8f728c8e774aB81D14d0B2F07a8238960f4, watches each BPool and automatically stakes or unstakes the paired datatoken whenever a liquidity provider moves mOCEAN into or out of the pool on its own, intended to keep both sides of the pool proportionate without requiring the provider to supply the datatoken directly.

The proof of concept DeFiHackLabs published, read in full here, targets eight separate BPool pools in a single transaction. It opens with a same-token flash swap pulling close to 99 percent of the mOCEAN reserve out of an unrelated Uniswap V2 pair, then runs an identical loop against each of the eight pools in turn.

The loop run against each pool

  1. Repeatedly call joinswapExternAmountIn() with mOCEAN, a single-sided deposit that credits pool tokens back to the caller, each call capped at roughly half the pool's recorded mOCEAN balance, continuing until no mOCEAN is left to deposit or the loop has run sixteen times.
  2. Call gulp(MOCEAN) once. Balancer-style pools use gulp to resync a token's recorded internal balance with its actual balance in the contract, a step normally meant to absorb an accidental donation. Here it runs immediately after a sequence of joins and before any exit.
  3. Repeatedly call exitswapPoolAmountIn(), a single-sided withdrawal back to mOCEAN, each call capped at the smaller of the caller's pool-token balance and a quarter of the pool's total pool-token supply, again continuing until the balance is exhausted or the loop hits sixteen calls.

The proof of concept's own comment states the underlying cause directly: BPool's join and exit math is not symmetric, and SideStaking mirrors every single-sided join or exit with a matching datatoken stake or unstake rather than checking whether the round trip left the pool as it found it. Run enough times across enough pools, the small asymmetry between what a join charges and what the matching exit returns compounds into a real mOCEAN surplus, and the mid-loop gulp call appears positioned to refresh the pool's recorded mOCEAN balance before the exits draw against it, rather than to absorb any genuine donation.

The attacker's address, 0x3Fa8cF7FeA68C8E76A9838d77889464DdFb6a6cf, and the flash swap's repayment leave DeFiHackLabs' reported loss, about 127.86K mOCEAN, as the only loss figure available. No source beyond the reproduction states the loss in USD, so none is given here. The attack transaction sits at 0x6dc8a7fba1303faef3ec7afa770b90b17ec5ecd73b51229277a9b0492e285796 on Polygonscan. Eight Ocean BPool pools are named as affected in the proof of concept. No statement from Ocean Protocol and no independent news coverage of this specific incident has been published.

What would have prevented it is a gulp that cannot be called mid-sequence by an address that has not provided the balance it is resyncing, and a SideStaking mirror that checks the pool's own invariant before and after each round trip rather than mirroring every single-sided call on faith that join and exit cancel out.

Sources read (2)

Other exploits

Query every incident yourself — free, no signup

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