Skip to content

GHSA-2gf8-q9rr-jq3h CVE-2026-52733

zebrad has persistent on-disk corruption of Sapling/Orchard subtree roots after chain fork via pop_tip

Medium crates.io
Severity
6.5 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
0.44%
Chance of exploitation in the next 30 days. Higher than 37.90% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-459 Incomplete Cleanup
CWE-672 Operation on a Resource after Expiration or Release
Fix
Available
2 packages have a fixed version

Description

Am I affected

You are affected if:

  1. You run zebrad up to and including v4.4.1.
  2. Your node participates in a network where chain forks occur (mainnet, testnet, or any network with multiple miners).

All default configurations are affected. The corruption persists across restarts because it is written to RocksDB.

Summary

When pop_tip removes the tip block during a chain fork, stale Sapling and Orchard note commitment subtree root data is retained in the in-memory non-finalized state. When the chain subsequently finalizes, this stale data is written to the persistent RocksDB state. The corrupted subtree root history affects z_getsubtreesbyindex (used by lightwalletd for wallet synchronization) and could affect future chain verification that depends on correct subtree roots.

Details

The non-finalized state provides two methods for removing blocks: pop_root (removes the oldest block during finalization) and pop_tip (removes the newest block during a fork revert). pop_root correctly cleans up note commitment subtree contributions. pop_tip does not: it removes the block but retains the block's subtree root contributions in the in-memory state.

When a chain fork occurs and pop_tip reverts the old tip, the winning fork's chain is extended. When that chain is later finalized, the stale subtree data from the reverted blocks is included in the RocksDB write batch and persisted to disk.

The pop_root/pop_tip asymmetry is specific to subtree root handling. Other state managed by pop_tip (nullifiers, UTXOs, anchors, block hashes) uses different cleanup patterns that are not affected.

Patches

zebra-state 7.0.0 and zebrad 4.5.0.

The fix adds subtree root cleanup to pop_tip matching the pattern already used by pop_root.

Workarounds

There is no configuration-level workaround. Chain forks are natural events on any Proof-of-Work network. Operators can mitigate the downstream impact by periodically verifying subtree root consistency using z_getsubtreesbyindex against a known-good reference.

Impact

Persistent corruption of Sapling and Orchard subtree root history in the RocksDB state database. The corruption survives node restarts. Downstream consumers that rely on z_getsubtreesbyindex for wallet synchronization (primarily lightwalletd and light wallets) receive incorrect subtree roots. This does not directly affect consensus validation of new blocks but can cause wallet synchronization failures or incorrect wallet state. Recovery requires rebuilding the state database from scratch.

Credit

Reported by @dingledropper via a private GitHub Security Advisory submission.

Affected versions

crates.io

PackageVulnerableFixed in
zebra-state
< 7.0.0
7.0.0
zebrad
< 4.5.0
4.5.0

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

zebra-state crates.io → 7.0.0

cargo
cargo update -p zebra-state --precise 7.0.0

zebrad crates.io → 4.5.0

cargo
cargo update -p zebrad --precise 4.5.0

Severity breakdown

CVSS 3.1 6.5

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:L

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
Low

Weakness

CWE-459: Incomplete Cleanup

The product does not properly "clean up" and remove temporary or supporting resources after they have been used.

How to prevent it
  • Architecture and Design, Implementation: Temporary files and other supporting resources should be deleted/released immediately after they are no longer needed.

CWE-672: Operation on a Resource after Expiration or Release

The product uses, accesses, or otherwise operates on a resource after that resource has been expired, released, or revoked.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-ww9q-8r59-xv46
Zebra: Missing copy constraint in halo2_gadgets variable-base scalar multiplication allows under-constrained base, breaking Orchard Action circuit soundness
Critical Also affects zebrad
GHSA-63wg-wjjj-7cp8
Zebra Address Book Aborted by IPv4-Mapped Mempool Misbehavior Update
High Also affects zebrad
GHSA-65jj-fmw8-468q
zebrad has unbounded memory leak in mempool download pipeline via timeout path cancel_handles retention
Medium Also affects zebrad
GHSA-hhm7-qrv5-h4r6
Zebra: Repeated Non-Finalized Shielded Transaction Aborts Zebra Before Duplicate-Nullifier Rejection
Medium Also affects zebrad
GHSA-w834-cf6p-9m9w
Zebra: Finalized address balance credit-first overflow on consensus-valid blocks
Medium Also affects zebrad
GHSA-gvjc-3w7c-92jx
Zebra has sync restart poisoning from single unauthenticated peer via above-lookahead block
Medium Also affects zebrad
GHSA-gf9r-m956-97qx
zebrad has consensus divergence via P2SH sigop undercount in pure-Rust disabled-opcode parser
Critical Also affects zebrad
GHSA-4m69-67m6-prqp
Zebra has block suppression via NU5 same-header body poisoning of sent-hash cache
High Also affects zebrad
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor