Maya Protocol (MAYAChain)
Why it happened
Attack class: Logic errorA batch of messages faked a missing payout, the theft routine paid an uncapped subsidy into a thin pool, and a failed funding transfer was never rolled back.
What would have stopped it
- Make pool credits and their funding transfers atomic
- Cap compensation subsidies against pool depth and Reserve balance
Not scored before the exploit
BlackHart had not scored Maya Protocol (MAYAChain) before this exploit.
An attacker drained about $1.7 million from Maya Protocol, the THORChain-style cross-chain exchange on MAYAChain, by chaining several accounting bugs that made the network credit a nearly empty ARB.LINK pool with about 49.45 million CACAO that never arrived. They bought almost the whole pool for 100 CACAO, withdrew about 48.87 million real CACAO from the shared liquidity and sold it for 20.83 BTC plus a little ETH and LINK, which crashed CACAO by nearly 89% and cut pool value by about $11 million. Every liquidity provider in Maya's pools absorbed the loss; no keys or vaults were compromised. The BTC sat untouched until early November, when it was moved to a fresh Bitcoin address.
The attacker's MAYAChain address sent a 23-message transaction that tricked MAYAChain into crediting the ARB.LINK pool with CACAO it never received, then bought and withdrew the pool and swapped the CACAO for 20.83 BTC sent to a Bitcoin address, later moved to a fresh address.
Attack flow
All 6 on-chain stepsThe attack in 3 steps. Step 1, Phantom credit: ARB.LINK pool (source). Step 2, Pool drain: Attacker MAYAChain address (attacker), about $1.7M reached this step. Step 3, Bitcoin exit: Attacker Bitcoin address (attacker), Consolidation address (exit), about $1.34M reached this step.
Step 1: Phantom credit
- SourceARB.LINK pool+49.45M CACAO on the booksReserve held only about 168K
Step 2: Pool drain
- AttackerAttacker MAYAChain address100 CACAO buys 99.93% of the pool48.87M CACAO withdrawnmaya1dl3yr...mwsv8x
Step 3: Bitcoin exit
- AttackerAttacker Bitcoin address20.83 BTC~ $1.34Mbc1q0hsgwu...y5l646
- ExitConsolidation address20.83 BTC since 5 Novunspentbc1qlvj5nv...ftgszc
Why each step worked
- Shared transaction ID overwrote outbound trackingmaya1dl3yrfpedyr5jfr0r86s2apjltnjqgszmwsv8x
- Uncapped theft-slash subsidyno limit against pool depth or Reserve balance
- No rollback when the Reserve transfer failedmissing controlpool credit kept after the funding error
- Withdrawals trusted the pool's book balancepaid from shared Asgard liquidity
- No circuit breaker on a CACAO price collapsemissing controlswaps kept clearing as CACAO fell 89%
Full forensic detail
Step-by-step reconstruction, root cause, counterfactuals, remediation, and disclosure timeline.
Exploit anatomy
Root cause
No key or contract was compromised. The attacker chained several edge cases in MAYAChain's own node software, per the team's preliminary analysis, SlowMist and the published reconstructions. First, several messages in one transaction could share a single ID, and the last one overwrote the record MAYAChain uses to match outbound payments, so genuine payouts looked missing. Second, the theft-detection path that then fired paid a compensation subsidy into the affected pool with no cap against the pool's size. Third, that credit was written to the pool before the Reserve transfer meant to fund it; when the transfer failed for lack of funds, the error was logged and the pool write was kept. The result was a pool with about 49.45 million CACAO on its books and almost nothing real behind it. Pool math then treated the near-empty pool as fresh, so a 100 CACAO deposit bought almost all of it, and withdrawals paid out of the shared Asgard vault trusted the pool's book balance. The real CACAO taken came from every other liquidity provider.
Prevention analysis
If the failed Reserve transfer had rolled back the pool credit, the ARB.LINK pool would never have shown CACAO that did not exist, and there would have been nothing to withdraw.
A 49.45 million CACAO credit to a pool holding almost nothing, from a Reserve holding 168,000, should have been rejected outright. A cap would have limited the subsidy to a small fraction of that.
Rejecting batches whose messages overwrite each other's outbound records would have kept the genuine LINK payouts matched and the theft detector quiet.
Similar incidents
MAYAChain is a fork of THORChain, which lost about $13 million in 2021 to attacks on how its nodes matched deposits, refunds and outbound payments. Same family: node accounting that can be steered into paying out value that was never deposited.
A balance was credited without the matching funds ever moving, and the attacker swapped the phantom balance for real liquidity. Same family: one side of a two-sided balance change silently fails.
Remediation
Timeline
Get your protocol scored across 12 dimensions, or request ongoing coverage.