Mezo: ERC-20 bridgeOut burn can be erased by a stale StateDB overwrite leading to full L1 bridge drain
Date: 2026-05
Affected: go/github.com/mezo-org/mezod
Attack vector: path-traversal
Category: vulnerability-disclosure
Severity: High
CWE: CWE-662

**Note: the fixed version of the validator client has been deployed for some time.** ### Impact Potential full drain of L1 bridge without changing bridged balance on Mezo. ## Brief/Intro A malicious user can steal all ERC-20 tokens locked in the L1 bridge by repeatedly calling the `bridgeOut` precompile from a crafted contract. The precompile's ERC-20 burn executes in an **inner StateDB** that commits to a cache context, but the **outer StateDB** still holds stale pre-burn storage slots in its `dirtyStorage`. When the outer transaction commits, it overwrites the inner burn with stale values -- **restoring the attacker's balance and allowance** while the `AssetsUnlocked` event has already been persisted to the bridge store. The Ethereum sidecar observes this event and attests the unlock on L1, releasing real tokens to the attacker. The attacker keeps their Mezo balance intact and can repeat the drain every block. ## Vulnerability Details Mezo's EVM uses a dual-context state architecture for precompile calls. When a precompile is invoked, `Contract.Run()` calls `stateDB.CacheContext()` which creates a `cachedCtx` branched from the base `ctx`. Cosmos-side state changes (like ERC-20 burns) happen on `cachedCtx`, while standard EVM storage operations (SLOAD/SSTORE) operate on the outer StateDB's `dirtyStorage` backed by `baseCtx`. The `bridgeOut` precompile handles two token types with fundamentally different mechanisms: - **BTC (`burnBitcoin`)**: Burns via `x/bank` (Cosmo


Mitigations:

Architectural layers (MAESTRO):