# Zebra: Cached Mempool Verification Bypasses Consensus Rules for Ahead-of-Tip Blocks

Zebra's mempool verification cache skipped height-dependent checks, letting a malicious miner get an expired transaction accepted in an ahead-of-tip block and split consensus.

- Payout: Research
- Severity: high
- Program: Zebra
- Found by: sangsoo-osec
- Disclosed: 2026-04-18
- CVE: CVE-2026-40880
- Write-up quality: 7/10
- Original: https://github.com/advisories/GHSA-xvj8-ph7x-65gf
- Library page: http://bugbountylibrary.com/r/ghsa%3AGHSA-xvj8-ph7x-65gf
- Tags: area:web3 domain:web3 impact:dos impact:integrity kind:research platform:ghsa sev:high tech:rust technique:incomplete-fix technique:source-review vuln:accounting-error vuln:business-logic

**Target:** Zcash full node transaction verification cache (zebra-consensus)
**Root cause:** A performance optimization skipped re-verification of transactions already accepted into the mempool, ignoring that validity is height-dependent (expiry height, lock time, network upgrade binding).
**Steps:**
1. Submit a transaction with expiry height `H+1` where `H` is the current tip, getting it cached as valid in the mempool.
2. Mine block `H+1` and block `H+2` containing that same transaction.
3. Submit block `H+2` before `H+1`; Zebra accepts it pending contextual verification and waits for `H+1`.
4. When `H+1` arrives, Zebra commits both blocks even though `H+2` contains an expired transaction.
5. Other nodes (zcashd, unaffected zebrad) reject the block, forking the poisoned Zebra node off the network.
**How found:** Reporter noticed the cache optimization assumed mempool acceptance implied permanent validity, missing that expiry height, lock time and network-upgrade binding are height-dependent; a second reporter found the same class applied to other transaction validation aspects.
**Exploitation:** A malicious miner with block-production capability crafts a height-sensitive transaction, seeds it into victim mempools, then delivers an ahead-of-tip block out of order so the cached-valid transaction is committed past its expiry, isolating the node on a divergent chain.
**Escalation:** Consensus split enables network partitioning, service disruption, and potential double-spend against affected nodes.
**Insight:** When auditing validation caches or memoized 'already verified' shortcuts, enumerate every input that is context-dependent (height, epoch, upgrade, time) and check whether the cache key includes them; a cache keyed only on txid silently freezes a verdict that later becomes wrong.

