CVE-2026-40880: Zebra Cached Mempool Verification Bypasses Consensus Vulnerability

HIGH
Advisory Identifier: GHSA-xvj8-ph7x-65gf
CWE-1025
Published
Advisory Summary

CVE-2026-40880 is a HIGH cached mempool verification bypasses consensus vulnerability (CWE-1025: Comparison Using Wrong Factors) affecting Zebra libraries in the crates.io ecosystem. The issue involves cached mempool verification bypasses consensus rules for ahead-of-tip blocks. Remediation is available by upgrading affected packages to version 5.0.2, 4.3.1.

CVE-2026-40880 at a Glance

CVE Identifier CVE-2026-40880
GHSA Identifier GHSA-xvj8-ph7x-65gf
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-1025: Comparison Using Wrong Factors
Affected Product Zebra
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix CVE-2026-40880

To remediate this vulnerability, upgrade all affected Zebra dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

zebra-consensus fixed: 5.0.2
Upgrade zebra-consensus to 5.0.2
zebrad fixed: 4.3.1
Upgrade zebrad to 4.3.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for zebra-consensus

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-40880, inspect your project dependencies for Zebra:

inspect dependencies for zebra-consensus

Analyze the terminal output to locate any version of Zebra in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.0.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1025: Comparison Using Wrong Factors, where the code performs a comparison between two entities, but the comparison examines the wrong factors or characteristics of the entities, which can lead to incorrect results and resultant weaknesses. In Zebra, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

# CVE-2026-40880: Cached Mempool Verification Bypasses Consensus Rules for Ahead-of-Tip Blocks ## Summary A logic error in Zebra's transaction verification cache could allow a malicious miner to induce a consensus split. By carefully submitting a transaction that is valid for height `H+1` but invalid for `H+2` and then mining that transaction in a block at height `H+2`, a miner could cause vulnerable Zebra nodes to accept an invalid block, leading to a consensus split from the rest of the Zcash network. ## Severity High - This is a Consensus Vulnerability that could allow a malicious miner to induce network partitioning, service disruption, and potential double-spend attacks against affected nodes. ## Affected Versions All Zebra versions prior to version 4.3.1. (Some older versions are not affected but are no longer supported by the network) ## Description The vulnerability exists due to a performance optimization whose goal is to improve performance of transaction validation if the transaction was previously accepted into the mempool (and thus was verified as valid). That however did not take into account that a transaction can be valid for a specific height, but invalid at higher heights; for example, it can contain an expiry height, a lock time, and it is always bound to a network upgrade, all of which are height-dependant. An attacker (specifically a malicious miner) could exploit this by (e.g. in the expiry height case): - Submitting a transaction with expiry height `H+1` (where `H` is the height of the current tip) - Mining a block `H+1`, and a block `H+2` that contains that same transaction, and submitting block `H+2` before `H+1` - Zebra nodes would accept `H+2` as valid (pending contextual verification) and wait for block `H+1`; when it arrives, Zebra would commit both blocks even if `H+2` contains an expired transaction - Other nodes (like `zcashd` or `zebrad` nodes without that transaction in their mempool) reject the block, resulting in a chain fork where the poisoned Zebra node is isolated. ## Impact **Consensus Failure** **Attack Vector**: Network (specifically via a malicious miner). **Effect**: Network partition/consensus split. **Scope**: Any Zebra node utilizing the transaction verification cache optimization for V5 transactions. ## Fixed Versions This issue is fixed in **Zebra 4.3.1**. We removed the performance optimization altogether, since we deemed it too risky. The fix ensures that verification is only skipped if the transaction's full integrity—including authorization data—is validated against the mempool entry. ## Mitigation Users should upgrade to Zebra 4.3.0 or later immediately. There are no known workarounds for this issue. Immediate upgrade is the only way to ensure the node remains on the correct consensus path and is protected against malicious chain forks. ## Credits Thanks to @sangsoo-osec for a thorough advisory submission that noticed the lock time issue, and to @shieldedonly with an also thorough advisory (that was submitted while we were working on the first one) who noticed that the issue applied to other aspects of the transaction validation.

CVE-2026-40880 Affected Zebra Versions

2 component(s)
Fixed Versions:
5.0.24.3.1
Product / Package Ecosystem Affected Versions Fixed Version
zebra-consensus
crates.io
< 5.0.2
5.0.2
zebrad
crates.io
< 4.3.1
4.3.1

References

Frequently Asked Questions

What is CVE-2026-40880?
CVE-2026-40880 is a security vulnerability in Zebra involving Cached Mempool Verification Bypasses Consensus Rules for Ahead-of-Tip Blocks under CWE-1025: Comparison Using Wrong Factors.
Which Zebra versions are affected?
Affected versions include releases prior to 5.0.2, 4.3.1 across affected packages: zebra-consensus, zebrad.
What version fixes CVE-2026-40880?
Upgrading to 5.0.2, 4.3.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is zebra-consensus affected?
Yes, zebra-consensus is affected in releases prior to 5.0.2. Upgrade your dependency to 5.0.2 or later.
Is zebrad affected?
Yes, zebrad is affected in releases prior to 4.3.1. Upgrade your dependency to 4.3.1 or later.
What CWE is associated with CVE-2026-40880?
CVE-2026-40880 is classified under CWE-1025: Comparison Using Wrong Factors (The code performs a comparison between two entities, but the comparison examines the wrong factors or characteristics of the entities, which can lead to incorrect results and resultant weaknesses.).
How can I check crates.io dependencies for CVE-2026-40880?
Run the dependency tree command: 'inspect dependencies for zebra-consensus'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xvj8-ph7x-65gf",
  "modified" : "2026-04-27T16:17:07Z",
  "published" : "2026-04-18T00:41:54Z",
  "aliases" : [ "CVE-2026-40880" ],
  "summary" : "Zebra: Cached Mempool Verification Bypasses Consensus Rules for Ahead-of-Tip Blocks",
  "details" : "# CVE-2026-40880: Cached Mempool Verification Bypasses Consensus Rules for Ahead-of-Tip Blocks\n\n## Summary\n\nA logic error in Zebra's transaction verification cache could allow a malicious miner to induce a consensus split. By carefully submitting a transaction that is valid for height `H+1` but invalid for `H+2` and then mining that transaction in a block at height `H+2`, a miner could cause vulnerable Zebra nodes to accept an invalid block, leading to a consensus split from the rest of the Zcash network.\n\n## Severity\n\nHigh - This is a Consensus Vulnerability that could allow a malicious miner to induce network partitioning, service disruption, and potential double-spend attacks against affected nodes.\n\n## Affected Versions\n\nAll Zebra versions prior to version 4.3.1. (Some older versions are not affected but are no longer supported by the network)\n\n## Description\n\nThe vulnerability exists due to a performance optimization whose goal is to improve performance of transaction validation if the transaction was previously accepted into the mempool (and thus was verified as valid). That however did not take into account that a transaction can be valid for a specific height, but invalid at higher heights; for example, it can contain an expiry height, a lock time, and it is always bound to a network upgrade, all of which are height-dependant.\n\nAn attacker (specifically a malicious miner) could exploit this by (e.g. in the expiry height case):\n\n- Submitting a transaction with expiry height `H+1` (where `H` is the height of the current tip)\n- Mining a block `H+1`, and a block `H+2` that contains that same transaction, and submitting block `H+2` before `H+1`\n- Zebra nodes would accept `H+2` as valid (pending contextual verification) and wait for block `H+1`; when it arrives, Zebra would commit both blocks even if `H+2` contains an expired transaction\n- Other nodes (like `zcashd` or `zebrad` nodes without that transaction in their mempool) reject the block, resulting in a chain fork where the poisoned Zebra node is isolated.\n\n## Impact\n\n**Consensus Failure**\n\n**Attack Vector**: Network (specifically via a malicious miner).\n**Effect**: Network partition/consensus split.\n**Scope**: Any Zebra node utilizing the transaction verification cache optimization for V5 transactions.\n\n## Fixed Versions\n\nThis issue is fixed in **Zebra 4.3.1**.\n\nWe removed the performance optimization altogether, since we deemed it too risky.\n\nThe fix ensures that verification is only skipped if the transaction's full integrity—including authorization data—is validated against the mempool entry.\n\n## Mitigation\n\nUsers should upgrade to Zebra 4.3.0 or later immediately.\n\nThere are no known workarounds for this issue. Immediate upgrade is the only way to ensure the node remains on the correct consensus path and is protected against malicious chain forks.\n\n## Credits\n\nThanks to @sangsoo-osec for a thorough advisory submission that noticed the lock time issue, and to @shieldedonly with an also thorough advisory (that was submitted while we were working on the first one) who noticed that the issue applied to other aspects of the transaction validation.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:H/SC:N/SI:H/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "zebra-consensus"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.0.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "zebrad"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.3.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ZcashFoundation/zebra/security/advisories/GHSA-xvj8-ph7x-65gf"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40880"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ZcashFoundation/zebra"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1025" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-18T00:41:54Z",
    "nvd_published_at" : "2026-04-21T20:17:01Z"
  }
}