6.9medium
ZEBRA: Finalized address balance credit-first overflow on consensus-valid blocks
- Severity
- 6.9medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.37% (higher than 33% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-w834-cf6p-9m9w
Description
ZEBRA is a Zcash node written entirely in Rust. Prior to 4.5.0, a consensus-valid block containing a long chain of transparent self-spends to one address can permanently halt Zebra nodes. In zebra-state/src/service/finalized_state/zebra_db/transparent.rs, the finalized-state writer originally applied every newly created output as a credit before applying any spent-output debit from the same block. That credit-first ordering can make the intermediate per-address balance exceed MAX_MONEY even though the final net balance is valid, causing an expect-based panic under the panic equals abort release profile. Because zcashd accepts the triggering block and Zebra encounters it again after every restart, the halt persists until patched software is deployed; exploitation requires mining the specially constructed block and temporarily committing sufficient ZEC to the self-spend chain. This issue is fixed in version 4.5.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| ZcashFoundation zebra | < 4.5.0 | CVE List |
| ZcashFoundation zebra-state | < 7.0.0 | CVE List |
| zebra-state (crates.io) | before 7.0.0 | GitHub Advisory Database |
| zebrad (crates.io) | before 4.5.0 | GitHub Advisory Database |
All scores
| GitHub_M | 6.9medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
ZEBRA is a Zcash node written entirely in Rust. Prior to 4.5.0, a consensus-valid block containing a long chain of transparent self-spends to one address can permanently halt Zebra nodes. In zebra-state/src/service/finalized_state/zebra_db/transparent.rs, the finalized-state writer originally applied every newly created output as a credit before applying any spent-output debit from the same block. That credit-first ordering can make the intermediate per-address balance exceed MAX_MONEY even though the final net balance is valid, causing an expect-based panic under the panic equals abort release profile. Because zcashd accepts the triggering block and Zebra encounters it again after every restart, the halt persists until patched software is deployed; exploitation requires mining the specially constructed block and temporarily committing sufficient ZEC to the self-spend chain. This issue is fixed in version 4.5.0.
GitHub Advisory Database
Am I affected
You are affected if:
- You run
zebradup to and includingv4.4.1. - Your node processes blocks on any Zcash network.
Summary
The finalized transparent address balance writer processes all newly-created outputs (credits) before processing spent outputs (debits) within the same block. A consensus-valid block containing a long chain of same-address transparent self-spends can cause the intermediate per-address balance during the credit pass to exceed MAX_MONEY, triggering a panic in the finalized state writer.
Because the triggering block is consensus-valid (zcashd accepts it), the panic recurs on restart when the node re-encounters the same block. This creates a persistent chain halt that can only be resolved by a software patch.
Details
The finalized state writer at zebra-state/src/service/finalized_state/zebra_db/transparent.rs iterates all transaction outputs in a block and credits them to per-address balances before iterating inputs and debiting spent outputs. When a block contains many transparent self-spends to the same address, the intermediate credit-only balance can exceed the MAX_MONEY supply cap even though the final net balance (credits minus debits) is valid.
The code panics on the intermediate overflow via .expect() on the balance addition. Under Zebra's panic = "abort" release profile, this terminates the process. On restart, the node re-downloads and re-processes the same consensus-valid block, triggering the same panic.
An attacker with approximately 1,100–2,100 ZEC and mining capability can construct a block that permanently halts all Zebra nodes. The attacker recovers their capital (the self-spends return funds to the same address), so the net cost is the mining effort only.
Patches
Patched in Zebra 4.4.2. The fix processes credits and debits together per transaction rather than all credits then all debits, matching zcashd's approach.
Workarounds
No workaround is available. Upgrade to Zebra 4.4.2.
Impact
A single consensus-valid mined block can permanently halt all Zebra nodes on the network. The halt persists across restarts. Recovery requires deploying a patched version. Downstream consumers (light wallets, exchanges, mining infrastructure) lose service for the duration of the halt.
Credit
Reported by @sangsoo-osec.
NVD (es)
ZEBRA es un nodo Zcash escrito completamente en Rust. Antes de 4.5.0, un bloque válido por consenso que contiene una larga cadena de auto-gastos transparentes a una única dirección puede detener permanentemente los nodos Zebra. En zebra-state/src/service/finalized_state/zebra_db/transparent.rs, el escritor de estado finalizado originalmente aplicaba cada salida recién creada como un crédito antes de aplicar cualquier débito de salida gastada del mismo bloque. Ese orden de ’crédito primero’ puede hacer que el saldo intermedio por dirección exceda MAX_MONEY aunque el saldo neto final sea válido, causando un pánico basado en ’expect’ bajo el perfil de lanzamiento ’panic equals abort’. Debido a que zcashd acepta el bloque desencadenante y Zebra lo encuentra de nuevo después de cada reinicio, la detención persiste hasta que se implementa software parcheado; la explotación requiere minar el bloque especialmente construido y comprometer temporalmente suficiente ZEC a la cadena de auto-gastos. Este problema está solucionado en la versión 4.5.0.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-52738 changed 2026-08-19 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-w834-cf6p-9m9w changed 2026-07-02 | CC-BY-4.0 |
| NVD | CVE-2026-52738 changed 2026-11-09 | Public domain |