Skip to main content

CVE-2026-52735 — Vulnerability in zebrad — CVE Details

CRITICAL

zebrad has consensus divergence via P2SH sigop undercount in pure-Rust disabled-opcode parser

Published July 2, 2026Updated July 2, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.51%). Schedule for your next planned update.

Does your project use an affected zebrad version?

Paste your Cargo.lock to check it for CVE-2026-52735 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my Cargo.lock

Summary

Am I affected

You are affected if:

  1. You run any version of zebrad up to and including v4.4.1.
  2. Your node validates blocks on mainnet, testnet, or any network where both Zebra and zcashd nodes participate.

All default configurations are affected. No feature flags, non-default settings, or special build options are required.

Summary

Zebra's P2SH sigop counter uses a pure-Rust code path that short-circuits on disabled opcodes (such as OP_CODESEPARATOR), returning a partial count of zero for any sigops following the disabled opcode. The reference implementation (zcashd) correctly counts through disabled opcodes in its static sigop analysis. This produces a consensus divergence: Zebra accepts blocks that zcashd rejects when the block-wide MAX_BLOCK_SIGOPS = 20,000 threshold is crossed on one side but not the other.

An attacker can exploit this without mining capability. Broadcasting transactions that spend P2SH outputs with malicious redeem scripts is sufficient; any Zebra miner who includes those transactions in a block triggers a chain split between Zebra and zcashd validators.

Details

The P2SH sigop counter at zebra-script/src/lib.rs:399 calls script::Code(redeemed_bytes).sig_op_count(true), which is a pure-Rust path through zcash_script-0.4.4. The legacy (non-P2SH) sigop counter at lib.rs:282-289 correctly uses the C++ FFI via interpreter.legacy_sigop_count_script(). Only the P2SH path bypasses the FFI.

The Rust parser in zcash_script-0.4.4/src/opcode/mod.rs:1247-1260 treats 16 disabled opcodes (0x7e through 0xab, including OP_CAT, OP_SUBSTR, OP_AND, OP_OR, OP_XOR, OP_2MUL, OP_2DIV, OP_MUL, OP_DIV, OP_MOD, OP_LSHIFT, OP_RSHIFT, and OP_CODESEPARATOR) as Err(Error::Disabled(...)). The sig_op_count function at iter.rs:104-115 uses try_fold, which terminates on the first Err and returns the partial sum accumulated so far.

zcashd's GetOp2 (script.h:514-562) returns true for all non-push opcodes including the disabled range. Its GetSigOpCount(true) (script.cpp:152-174) continues counting through disabled opcodes. zcashd rejects disabled opcodes at execution time in the interpreter, not during static sigop analysis.

A redeem script of [0xab, OP_CHECKMULTISIG x 50] produces: Zebra = 0 sigops, zcashd = 1,000 sigops. Across 21 inputs in a block, Zebra computes 0 while zcashd computes 21,000, crossing the MAX_BLOCK_SIGOPS = 20,000 threshold on one side only.

Patches

Patched in Zebra 4.4.2. The fix routes the P2SH sigop counter through the same C++ FFI already used by the legacy sigop counter.

Workarounds

There is no configuration-level workaround. All Zebra nodes validating blocks on a network shared with zcashd are affected. Upgrade as soon as the patched version is available.

Impact

A chain split between Zebra and zcashd validators. The attacker broadcasts spending transactions referencing P2SH outputs whose redeem scripts contain a disabled opcode followed by OP_CHECKSIG or OP_CHECKMULTISIG opcodes. When a Zebra miner (estimated ~30% of current network hashrate) includes these transactions in a block, Zebra validators accept the block while zcashd validators reject it with bad-blk-sigops. The two halves of the network diverge and every subsequent block extending the Zebra-side tip inherits the divergence.

The attacker does not need mining capability, RPC access, or any special privileges. The cost is the transaction fees for the funding and spending transactions.

Credit

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

Advisory Timeline

  • First published July 2, 2026 (147 days ago).
  • Last revised July 2, 2026 — 0 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Cargo
Update zebrad to 4.5.0 or later
cargo update -p zebrad --precise 4.5.0
Cargo
Update zebra-script to 7.0.0 or later
cargo update -p zebra-script --precise 7.0.0

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (2)

Affects 1 ecosystem: crates.io (2).

PackageFixed In
zebrad crates.io · Affected: All versions4.5.0
zebra-script crates.io · Affected: All versions7.0.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 10.0 score means for each attack dimension.

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

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:H/SA:H

Frequently Asked Questions

What is CVE-2026-52735?
zebrad has consensus divergence via P2SH sigop undercount in pure-Rust disabled-opcode parser. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 10.0/10).
How do I check if my project is affected by CVE-2026-52735?
CVE-2026-52735 affects zebrad and zebra-script. It has a 0.5% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-52735 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
10.0

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
0.51%
EPSS percentile: 36.4

This is a below-median EPSS score — only 36.4% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-gf9r-m956-97qx

Related CVEs

  • CVE-2026-41583
    CRITICAL

    Zebra Vulnerable to Consensus Divergence in Transparent Sighash Hash-Type Handling

  • CVE-2026-44497
    CRITICAL

    Zebra has Consensus Divergence in Transparent Sighash Hash-Type Handling due to Stale Buffer

  • CVE-2026-104435
    CRITICAL

    Zebra v4.4.0 still accepts V5 SIGHASH_SINGLE without a corresponding output

  • CVE-2026-34202
    CRITICAL

    Zebra node crash — V5 transaction hash panic (P2P reachable)

  • CVE-2026-54496
    CRITICAL

    Zebra: Missing copy constraint in halo2_gadgets variable-base scalar multiplication allows under-constrained base, breaking Orchard Action circuit soundness

  • CVE-2026-40880
    HIGH

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

  • CVE-2026-41585
    MEDIUM

    Zebra Vulnerable to Denial of Service via Interrupted JSON-RPC Requests from Authenticated Clients

  • CVE-2026-52731
    MEDIUM

    zebrad has full node denial of service via non-ASCII LongPollId in getblocktemplate

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Cargo.lock