---
id: "CVE-2026-52733"
page: "https://infrastack.ai/live/CVE-2026-52733"
kind: "vulnerability"
aliases: ["CVE-2026-52733", "GHSA-2gf8-q9rr-jq3h"]
title: "zebrad has persistent on-disk corruption of Sapling/Orchard subtree roots after chain fork via pop_tip"
severity: "medium"
cvss: 6.5
epss: 0.00436
exploited: false
status: "open"
category: "package"
products: [{"name": "zebra-state", "fixed": ["7.0.0"], "affected": "<= 6.0.0", "ecosystem": "cargo"}, {"name": "zebrad", "fixed": ["4.5.0"], "affected": "<= 4.4.1", "ecosystem": "cargo"}]
ecosystems: ["cargo"]
tags: ["cwe-459", "cwe-672", "lightwalletd", "package", "rocksdb", "zcash", "zebra-state", "zebrad"]
not_affected_if: ["no-zebrad", "zebrad-4.5.0-or-later"]
published_at: "2026-07-02T20:11:36+00:00"
first_seen_at: "2026-11-13T02:43:33+00:00"
updated_at: "2026-11-13T02:45:01+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-2gf8-q9rr-jq3h", "first_seen_at": "2026-11-13T02:43:33+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-52733", "first_seen_at": "2026-11-13T03:13:22+00:00"}]
exploit_sources: [{"type": "epss", "score": 0.00436, "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-52733"}]
---

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

Link for people: https://infrastack.ai/live/CVE-2026-52733 (this .md is for agents)

After a chain fork, zebrad keeps stale Sapling and Orchard subtree root data and writes it to its RocksDB state database when the new chain finalizes. Wallet-sync data served by z_getsubtreesbyindex, used by lightwalletd, can then be wrong and survives restarts.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- cargo:zebra-state affected <= 6.0.0 fixed 7.0.0
- cargo:zebrad affected <= 4.4.1 fixed 4.5.0

## How to check

- Check the zebrad version with `zebrad --version`; versions up to and including `4.4.1` are affected per the advisory.
- Check the zebra-state crate version in Cargo.lock; versions up to and including `6.0.0` are affected.
- Compare `z_getsubtreesbyindex` output against a known-good reference node, as the advisory suggests.

## Fix

- zebrad: move to `4.5.0`
- zebra-state: move to `7.0.0`

## Timeline

- 2026-11-13T02:43:33+00:00 ghsa https://github.com/advisories/GHSA-2gf8-q9rr-jq3h
- 2026-11-13T03:13:22+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-52733

## Documents

- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/ZcashFoundation/zebra/security-advisories/GHSA-2gf8-q9rr-jq3h
- [advisory] Maintainer's advisory: github.com https://github.com/ZcashFoundation/zebra/security/advisories/GHSA-2gf8-q9rr-jq3h
- [fix] Patch: github.com https://github.com/ZcashFoundation/zebra/commit/1440b43ca7df59aca948090d45117557b217a6cd
- [fix] Release notes: github.com https://github.com/ZcashFoundation/zebra/releases/tag/v4.5.0

## From the sources

### 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.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
