Skip to main content

zebrad CVE-2026-52734

| EUVDEUVD-2026-61164 MEDIUM
Memory Leak (CWE-401)
2026-07-02 https://github.com/ZcashFoundation/zebra GHSA-65jj-fmw8-468q
5.3
CVSS 3.1 · Vendor: https://github.com/ZcashFoundation/zebra
Share

Severity by source

Vendor (https://github.com/ZcashFoundation/zebra) PRIMARY
5.3 MEDIUM
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
vuln.today AI
7.5 HIGH

Network-accessible P2P port requires no authentication; sustained exploitation terminates the process via OOM kill, warranting A:H over the published A:L.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/ZcashFoundation/zebra).

CVSS VectorVendor: https://github.com/ZcashFoundation/zebra

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
Low

Lifecycle Timeline

1
Analysis Generated
Jul 02, 2026 - 20:41 vuln.today

DescriptionCVE.org

Am I affected

You are affected if:

  1. You run zebrad up to and including v4.4.1.
  2. Your node accepts inbound P2P connections (network.listen_addr is set, which is the default).
  3. Your node's mempool is active (node is synced near the chain tip).

All default configurations are affected.

Summary

The mempool download pipeline's cancel_handles map retains entries for transactions whose verification times out at the outer RATE_LIMIT_DELAY (73-second) boundary. The tokio::time::error::Elapsed error carries no payload, so the transaction ID is unrecoverable and the corresponding cancel_handles entry (including the full Gossip::Tx(UnminedTx), up to ~2 MB) is never removed. Entries accumulate monotonically with no upper bound or garbage collection, leading to eventual out-of-memory process termination.

Details

Downloads::poll_next() at zebrad/src/components/mempool/downloads.rs:215-228 handles three terminal states for a verification task:

  • Ok(Ok(...)): success. Calls cancel_handles.remove(&tx.transaction.id). Correct.
  • Ok(Err(...)): verification error. Calls cancel_handles.remove(&hash). Correct.
  • Err(elapsed): outer timeout. Returns Err(elapsed) without removing anything. Bug.

tokio::time::error::Elapsed has no payload, so the timed-out transaction's UnminedTxId is unrecoverable from the error. The consumer at zebrad/src/components/mempool.rs:663-672 explicitly acknowledges this gap with a TODO comment.

The only cleanup paths for cancel_handles are cancel(mined_ids) (removes entries matching mined transaction IDs; attacker transactions are never mined) and cancel_all() (clears everything on shutdown or chain reset). No periodic GC, no time-based eviction, and no count cap exists.

For direct tx pushes (Gossip::Tx), the retained entry holds the full deserialized transaction, which can be up to ~9 MB in memory for a transaction near the transparent-output extreme. Per-connection leak rate at worst case: ~685 KB/s (~2.4 GB/hour).

Patches

The fix preserves the UnminedTxId through the timeout error path: wrap the timeout future so the spawned task's outer error carries the txid (e.g., Err((txid, elapsed))). In Downloads::poll_next(), on the timeout arm, call cancel_handles.remove(&txid).

Workarounds

There is no configuration-level workaround. Restarting the node clears the accumulated entries. Operators running in memory-constrained environments (containers with cgroup limits) may see the process killed by the OOM killer before natural recovery.

Impact

Gradual, unbounded memory exhaustion of a Zebra node from unauthenticated P2P traffic. The leak is monotonic (entries are never freed under normal operation) but slow (~685 KB/s per connection worst case). An attacker must sustain traffic for hours to exhaust typical server memory. The node continues operating normally until memory pressure becomes critical, at which point the OS OOM killer terminates the process or the node degrades due to swap pressure. No consensus impact, no fund loss, no on-disk corruption.

Credit

Reported by @AnticsDecoded via a private GitHub Security Advisory submission. Working E2E reproduction on a live regtest node with staged parent/child transaction dependencies.

AnalysisAI

Unbounded memory exhaustion in zebrad's mempool download pipeline allows unauthenticated remote peers to crash Zcash full nodes by sustaining P2P transaction traffic. The root cause is that timed-out verification tasks never remove their entries from the cancel_handles map because tokio::time::error::Elapsed carries no payload, making the transaction ID unrecoverable at the timeout arm of Downloads::poll_next(). All nodes running zebrad up to v4.4.1 with default configuration are affected, and a working end-to-end reproduction exists on a live regtest network. No patch has been released at time of analysis; the only recovery action is a node restart.

Technical ContextAI

zebrad is the Zcash Foundation's Rust implementation of a Zcash full node (CPE: pkg:rust/zebrad). Its mempool component uses an async tokio-based download pipeline where in-flight transaction verifications are tracked in a cancel_handles HashMap keyed by UnminedTxId. The pipeline wraps each verification future in a tokio::time::timeout at the RATE_LIMIT_DELAY boundary (~73 seconds). When a timeout fires, the future returns Err(tokio::time::error::Elapsed). Because the Elapsed type carries no payload, the timed-out transaction's UnminedTxId is irrecoverably lost at that point. CWE-401 (Missing Release of Memory after Effective Lifetime) describes the root cause precisely: the cancel_handles entry - which holds the full deserialized Gossip::Tx(UnminedTx) up to ~9 MB - is allocated on inbound receipt and is never freed unless the transaction is mined (cancel_mined_ids) or the node shuts down (cancel_all). There is no periodic GC, no count cap, and no time-based eviction. The bug site is explicitly annotated with a TODO comment in the codebase at zebrad/src/components/mempool.rs:663-672, indicating the gap was known but not yet addressed.

RemediationAI

No vendor-released patch has been identified at time of analysis. The fix is described in the advisory: wrap the timeout future so the spawned task's outer error carries the UnminedTxId (e.g., Err((txid, elapsed))), then call cancel_handles.remove(&txid) in Downloads::poll_next() on the timeout arm. Operators should monitor the upstream repository at https://github.com/ZcashFoundation/zebra for a tagged release incorporating this fix. In the interim, there is no configuration-level workaround. The most effective compensating control is to periodically restart the zebrad process before memory pressure becomes critical - automated restart via systemd Restart=always or a container restart policy limits the blast radius to a brief service interruption rather than an OOM kill. Operators in memory-constrained environments (Docker/Kubernetes containers with cgroup memory limits) should lower those limits conservatively and configure restart policies, accepting that the node will restart more frequently. Restricting inbound P2P connections by IP allowlist or firewall would eliminate the attack surface entirely but defeats the purpose of running a publicly reachable full node.

Share

CVE-2026-52734 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy