Blog/Maya Protocol's $11M Exploit: How Six Chained Bugs Turned a Ghost Transaction Into a $CACAO Money Printer
Incident ReportMaya Protocol·MAYAChain

Maya Protocol's $11M Exploit: How Six Chained Bugs Turned a Ghost Transaction Into a $CACAO Money Printer

Maya Protocol halted MAYAChain on August 19, 2026 after an attacker exploited a chain of six discrete software vulnerabilities to manufacture 49 million $CACAO tokens from thin air, drain pools of Bitcoin and other assets, and trigger an 89% collapse in the token's price — causing $10.9M in total losses across liquidity providers, arbitrageurs, and token holders.

Protocol
Maya Protocol
Chain
MAYAChain
Total loss
$11M
Published
19 August 2026
Editorial Disclaimer

This article is published for educational and informational purposes only. It does not constitute legal, financial, or investment advice. Nothing in this article should be relied upon as the sole basis for any decision relating to the security, investment value, or legal standing of any protocol or digital asset.

This is a preliminary analysis based on publicly available reporting and open-source code review. An official post-mortem has not yet been published by the affected protocol at time of writing. Any code samples included are illustrative reconstructions for educational purposes only and do not represent confirmed exploit code. This article will be updated when authoritative technical disclosure is available.

Information published on any code vulnerabilities must not be used to attack, test, or probe any protocol or system without explicit authorisation from its owner. Use of this content is subject to our Terms of Service and Privacy Policy.

01

What happened

On August 19, 2026, an attacker executed a precisely sequenced exploit against MAYAChain, the cross-chain liquidity protocol at the core of Maya Protocol. The attack was not a brute-force intrusion. It was a deliberate, step-by-step traversal of six discrete software defects, each one setting up the next. The result was $1.65M in direct asset theft and $10.9M in total losses when cascading price effects are included.

The attack began around 17:30 UTC on August 18, 2026. The opening move involved manufacturing a false transaction state. The attacker sent a single transaction containing 23 sequentially structured messages, engineered so that the network incorrectly classified an outbound transfer as missing in transit. This is not a trivial deception: it required precise understanding of exactly how MAYAChain's outbound monitoring logic evaluated transaction finality.

That false classification triggered MAYAChain's internal theft-compensation mechanism, a safeguard designed to make liquidity providers whole when funds genuinely disappear during cross-chain transit. The compensation logic responded as designed and credited the low-liquidity Arbitrum Chainlink (ARB.LINK) pool with approximately 49.45 million CACAO tokens. The protocol's Asgard reserve held only around 168,000 CACAO at that moment. The credit was not validated against available reserves before being committed to the pool's state ledger.

The underlying token transfer ultimately failed to settle. But the balance entry had already been written. According to CryptoTimes, another bug meant the new balance had already been saved to the network's records before the failed transfer result was returned. Instead of rolling back the credit when the payment failed, MAYAChain continued operating as though the pool genuinely contained those tokens.

With the pool reflecting a fraudulently inflated $CACAO balance, the attacker deposited a negligible amount of capital into it. Their ownership share was calculated as 99.93% of the pool. They exercised that share immediately, withdrawing 48.87 million CACAO from Asgard and routing it through MAYAChain's swap pools. The attacker extracted approximately 20.83 BTC worth roughly $1.34M, plus approximately $300,000 in additional assets across ARB-based tokens and native CACAO.

Maya Protocol halted MAYAChain once the exploit was identified. The chain suspension prevented further direct drainage but could not reverse the token economics already in motion.

Total losses reached $10.9M: $1.65M taken directly by the attacker, $6.4M from CACAO's 89% price collapse as tokens were dumped into the market, and $2.9M drained by arbitrageurs exploiting dislocated prices across pools. According to BeInCrypto, this marks Maya Protocol as the 16th crypto hack recorded in 2026.
02

Root cause

The exploit was not a single vulnerability. It was a composed attack chain spanning six distinct software defects across three subsystems: trade account handling, outbound transaction processing, and liquidity pool calculation. Each defect was individually insufficient to cause material harm. Together, they formed a complete and repeatable exploit path.

Defect 1: Manipulable outbound transaction detection

The base of the chain was a flaw in MAYAChain's observed outbound transaction handler. MAYAChain is a fork of THORChain and shares its core architecture, including the pattern in which network observers watch for outbound transactions and report their status back to the chain state machine. The exploit manipulated the state records for outbound transfers so that a live transaction was classified as missing.

In the MAYANode codebase (hosted at gitlab.com/mayachain/mayanode), the observed txout handler is responsible for updating the status of outgoing transactions as nodes report them. The conceptual flow that was exploited looks like this:

handler_observed_txout.go (illustrative)MAYAChain / mayanode
// ObserveTxOut is called when bifrost observers report an outbound tx
func (h ObservedTxOutHandler) handle(ctx cosmos.Context, msg MsgObservedTxOut) error {
    for _, tx := range msg.Txs {
        // Fetch the pending TxOutItem from the store
        voter, err := h.mgr.Keeper().GetObservedTxOutVoter(ctx, tx.Tx.ID)
        if err != nil {
            return err
        }

        voter.Add(tx, msg.Signer)

        // [BUG 1]: The record tracking this outbound tx could be overwritten
        // by a crafted message sequence, causing the voter to appear unsettled
        // even when the transaction had already been broadcast.
        if voter.HasFinalised(h.mgr.GetConstants()) {
            h.mgr.Keeper().SetObservedTxOutVoter(ctx, voter)
            continue
        }

        // If not finalised, trigger missing-tx compensation path
        // [BUG 2]: This path was reached even though the tx had not truly gone missing
        h.slashIfMissingOutboundTx(ctx, voter, tx)
    }
    return nil
}

The exploit forced the code into the compensation path by overwriting the voter record for a real transaction, making it appear unfinalized. The 23-message transaction structure was necessary to sequence these overwrites correctly before the correct observation count was reached.

Defect 2: Write-before-verify in the compensation mechanism

Once the missing-transaction path was triggered, the compensation function calculated a remediation amount and credited it to the affected pool. The critical error was the ordering of operations: the balance was written to state before the function confirmed that the compensating transfer had actually succeeded. The conceptual pattern:

manager_vault.go (illustrative)MAYAChain / mayanode
func (vm *VaultMgrV1) compensateForStolenAssets(ctx cosmos.Context, pool Pool, amount cosmos.Uint) error {
    // Calculate compensation amount based on pool state
    compensationAmt := vm.calcCompensation(ctx, pool, amount)

    // [BUG 3]: Balance is credited BEFORE transfer is confirmed
    // If the transfer later fails, the credited balance is NOT rolled back
    pool.BalanceCacao = pool.BalanceCacao.Add(compensationAmt)
    if err := vm.mgr.Keeper().SetPool(ctx, pool); err != nil {
        return err
    }

    // Attempt the actual transfer — but result is not checked
    // against the pool balance write above
    _, err := vm.mgr.txOutStore().TryAddTxOutItem(ctx, vm.mgr, toi, cosmos.ZeroUint())
    if err != nil {
        // [BUG 4]: Error here does not trigger rollback of the pool.BalanceCacao credit
        ctx.Logger().Error("fail to compensate", "error", err)
    }

    return nil // pool balance remains inflated
}

Defects 3 through 6: Amplification and extraction

The four remaining defects allowed the attacker to capitalise on the inflated balance. Pool ownership unit calculations did not validate the depositor's claimed share against independently verified reserve depth. Withdrawal authorisation logic accepted the pool's self-reported balance as ground truth. The TxOut throttler and solvency checks that should have caught the anomalous withdrawal were bypassed because the pool state read by those checks already reflected the fraudulent credit. And swap rate-limiting was insufficient to block the rapid conversion of 48.87M CACAO into Bitcoin and other assets before the anomaly was flagged.

handler_withdraw_liquidity.go (illustrative)MAYAChain / mayanode
func (h WithdrawLiquidityHandler) handle(ctx cosmos.Context, msg MsgWithdrawLiquidity) error {
    pool, err := h.mgr.Keeper().GetPool(ctx, msg.Asset)

    // [BUG 5]: pool.BalanceCacao is read directly from state
    // State was poisoned by the compensation write in step 2
    // No independent reserve check is performed here
    withdrawAmt := calcWithdrawAmount(pool, msg.WithdrawBasisPoints)

    // withdrawAmt is now 48.87M CACAO — far exceeding actual reserves
    // [BUG 6]: Solvency check uses pool state, not Asgard vault balance
    if !h.mgr.Keeper().VaultSolvencyCheck(ctx, pool.Asset, withdrawAmt) {
        return errInsufficientFunds
    }
    // VaultSolvencyCheck passes because it reads pool.BalanceCacao (poisoned)
    // not the actual Asgard vault holding (~168K CACAO)

    return h.processWithdrawal(ctx, pool, msg.Signer, withdrawAmt)
}
Note: The code samples above are illustrative reconstructions based on MAYAChain's open-source architecture and the publicly reported vulnerability categories. The official post-mortem from the Maya Protocol team, which will include the confirmed affected functions and exact code paths, is expected to be published in the coming days at gitlab.com/mayachain/mayanode. This analysis will be updated upon its release.
03

What could have been done

The attack chain had multiple points at which a single additional control would have broken it entirely. Layered defences matter precisely because sophisticated attackers will find and exploit the weakest link in a sequence.

  • Confirm before crediting. The compensation mechanism must operate on an escrow-and-release model. Pool balance credits should be staged but not committed until the compensating transfer is confirmed as finally failed through independent verification. A rollback path must exist for every credit write.
  • Validate credits against protocol-wide reserve invariants. Any credit that would increase a pool's balance beyond the total available in the corresponding Asgard vault should be hard-rejected. This invariant check is a one-line guard that costs nothing during normal operation and would have made the 49.45M CACAO credit impossible to commit.
  • Harden outbound transaction finality detection. The missing-transaction detector should require confirmation from a supermajority of independent observer nodes before triggering compensation. A single message sequence should not be able to manufacture an unfinalized state for a transaction that was broadcast successfully.
  • Validate withdrawals against Asgard vault balance, not pool state.Pool state is a derived representation that can be poisoned. Withdrawal authorisation must cross-reference against the independently maintained Asgard vault balance. If these two figures diverge beyond a defined tolerance, the withdrawal should be blocked.
  • Apply swap volume rate-limiting as a circuit breaker. A swap of 48.87M CACAO has no precedent in normal protocol operation. Volume-based rate-limiting with a mandatory time-lock for anomalous sizes would have created an intervention window even after the balance was inflated.
  • Formally verify all compensation and minting code paths. Any function capable of crediting assets outside the standard issuance flow must be treated as a critical security surface and subjected to formal verification before deployment.
04

Lessons for the industry

The Maya Protocol exploit is a precise illustration of why DeFi security cannot be reduced to finding bugs one at a time. The six defects exploited here were not all individually critical. Their power was in composition. Security reviews must model attack chains explicitly, asking not just whether a given bug is exploitable in isolation, but whether it provides a necessary condition for a larger exploit sequence. Standard vulnerability assessment methodologies are not designed for this. Specialist threat modelling is required.

The specific failure at the centre of this incident, a compensation mechanism that writes balances before verifying settlement, is a known anti-pattern with a documented history across both traditional finance and DeFi. Its presence in a production protocol in 2026 is not a technical novelty. It is a process failure. Every code path that can create or credit balances outside the standard issuance flow must be treated with the same rigour as private key custody. Formal verification, independent audit, and continuous production monitoring are the minimum standard, not a gold-plated option.

As noted by CryptoWisser, the attacker personally extracted $1.65M from an event that caused $10.9M in total losses. The gap between those figures represents losses absorbed by liquidity providers who had no exposure to the vulnerable code, token holders caught in the price collapse, and traders hit by arbitrage-driven pool drainage. This socialisation of losses is a structural feature of DeFi exploits. Protocol designers must model contagion risk as a first-order concern during architecture design, not as an afterthought to be managed post-incident.

The 89% collapse in CACAO's price following the exploit is a reminder that token economics and protocol security are not separable. A protocol that can be made to manufacture tokens introduces unbounded sell pressure into the open market. That pressure does not stay within the protocol. It moves through every pool, every holder, every integrated service. Cross-chain liquidity networks amplify this effect further because the infected state propagates across chains before a halt can be executed.

Finally, MAYAChain is an open-source, public codebase. The precision of the 23-message exploit transaction reflects months of analysis of that code by the attacker. Every protocol with a complex, publicly readable implementation should assume that motivated researchers, including malicious ones, are studying it continuously and systematically. The appropriate response is not to restrict access to the code. It is to match that level of scrutiny on the defensive side through ongoing security research, red-teaming, and audit coverage that is proportionate to the value the protocol holds.

Share
Want to talk to our security team?
Book a free 30-minute call with a Deep Guard engineer to discuss your protocol's security needs.
Book a call
Get security insights in your inbox
New incident reports and research delivered when we publish. No spam.
Back to all posts