CVE-2026-40881: Zebra Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-xr93-pcq3-pxf8
CWE-770
Published
Advisory Summary

CVE-2026-40881 is a MODERATE remote code execution vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Zebra libraries in the crates.io ecosystem. The issue involves addr/addrv2 deserialization resource exhaustion. Remediation is available by upgrading affected packages to version 4.3.1, 5.0.1.

CVE-2026-40881 at a Glance

CVE Identifier CVE-2026-40881
GHSA Identifier GHSA-xr93-pcq3-pxf8
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product Zebra
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix CVE-2026-40881

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.

zebrad fixed: 4.3.1
Upgrade zebrad to 4.3.1
zebra-network fixed: 5.0.1
Upgrade zebra-network to 5.0.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 zebrad

How to Check if You Are Affected

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

inspect dependencies for zebrad

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 4.3.1), 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-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. 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-40881: addr/addrv2 Deserialization Resource Exhaustion ## Summary When deserializing `addr` or `addrv2` messages, which contain vectors of addresses, Zebra would fully deserialize them up to a maximum length (over 233,000) that was derived from the 2 MiB message size limit. This is much larger than the actual limit of 1,000 messages from the specification. Zebra would eventually check that limit but, at that point, the memory for the larger vector was already allocated. An attacker could cause out-of-memory aborts in Zebra by sending multiple such messages over different connections. ## Severity **Moderate** - This is a Denial of Service Vulnerability that could allow an attacker to crash a Zebra node. ## Affected Versions All Zebra versions prior to **version 4.3.1**. ## Description The vulnerability exists in the `read_addr/addrv2` functions in `codec.rs`. It deserializes a vector of addresses with the `zcash_deserialize()` trait method, which uses as a upper bound the result of `T::max_allocation()`. For theses types, it was derived from dividing the max message size (2 MiB) by the minimum serialized size of one entry. For AddrV1: 2_097_152 / 30 = 69,904. For AddrV2: 2_097_152 / 9 = 233,016. Only after deserialization was the `MAX_ADDRS_IN_MESSAGE = 1000` limit checked. An attacker could exploit this by: 1. Creating `addr` or `addrv2` messages with a large number of entries. 2. Submitting them to a Zebra node, possibly through multiple connections, to attempt to get Zebra into an out-of-memory state. ## Impact **Denial of Service** * **Attack Vector:** Network. * **Effect:** Zebra node crash. * **Scope:** Any impacted Zebra node. ## Fixed Versions This issue is fixed in **Zebra 4.3.1**. The fix changes the `max_allocation()` method for the relevant types to return 1,000, thus blocking larger values prior to deserialization. ## Mitigation Users should upgrade to **Zebra 4.3.1** or later immediately. There are no known workarounds for this issue. Immediate upgrade is the only way to ensure the node remains not vulnerable to the denial of service attack. ## Credits Thanks @Zk-nd3r for finding and reporting the issue, and suggesting the fix.

CVE-2026-40881 Affected Zebra Versions

2 component(s)
Fixed Versions:
4.3.15.0.1
Product / Package Ecosystem Affected Versions Fixed Version
zebrad
crates.io
< 4.3.1
4.3.1
zebra-network
crates.io
< 5.0.1
5.0.1

References

Frequently Asked Questions

What is CVE-2026-40881?
CVE-2026-40881 is a security vulnerability in Zebra involving addr/addrv2 Deserialization Resource Exhaustion under CWE-770: Allocation of Resources Without Limits or Throttling.
Which Zebra versions are affected?
Affected versions include releases prior to 4.3.1, 5.0.1 across affected packages: zebrad, zebra-network.
What version fixes CVE-2026-40881?
Upgrading to 4.3.1, 5.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is zebrad affected?
Yes, zebrad is affected in releases prior to 4.3.1. Upgrade your dependency to 4.3.1 or later.
Is zebra-network affected?
Yes, zebra-network is affected in releases prior to 5.0.1. Upgrade your dependency to 5.0.1 or later.
What CWE is associated with CVE-2026-40881?
CVE-2026-40881 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check crates.io dependencies for CVE-2026-40881?
Run the dependency tree command: 'inspect dependencies for zebrad'. 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-xr93-pcq3-pxf8",
  "modified" : "2026-04-27T16:17:12Z",
  "published" : "2026-04-18T00:42:05Z",
  "aliases" : [ "CVE-2026-40881" ],
  "summary" : "Zebra: addr/addrv2 Deserialization Resource Exhaustion",
  "details" : "# CVE-2026-40881: addr/addrv2 Deserialization Resource Exhaustion\n\n## Summary\n\nWhen deserializing `addr` or `addrv2` messages, which contain vectors of addresses, Zebra would fully deserialize them up to a maximum length (over 233,000) that was derived from the 2 MiB message size limit. This is much larger than the actual limit of 1,000 messages from the specification. Zebra would eventually check that limit but, at that point, the memory for the larger vector was already allocated. An attacker could cause out-of-memory aborts in Zebra by sending multiple such messages over different connections.\n\n## Severity\n\n**Moderate** - This is a Denial of Service Vulnerability that could allow an attacker to crash a Zebra node.\n\n## Affected Versions\n\nAll Zebra versions prior to **version 4.3.1**.\n\n## Description\n\nThe vulnerability exists in the `read_addr/addrv2` functions in `codec.rs`. It deserializes a vector of addresses with the `zcash_deserialize()` trait method, which uses as a upper bound the result of `T::max_allocation()`. For theses types, it was derived from dividing the max message size (2 MiB) by the minimum serialized size of one entry. For AddrV1: 2_097_152 / 30 = 69,904. For AddrV2: 2_097_152 / 9 = 233,016. Only after deserialization was the `MAX_ADDRS_IN_MESSAGE = 1000` limit checked.\n\nAn attacker could exploit this by:\n1. Creating `addr` or `addrv2` messages with a large number of entries.\n2. Submitting them to a Zebra node, possibly through multiple connections, to attempt to get Zebra into an out-of-memory state.\n\n## Impact\n\n**Denial of Service**\n\n* **Attack Vector:** Network.\n* **Effect:** Zebra node crash.\n* **Scope:** Any impacted Zebra node.\n\n## Fixed Versions\n\nThis issue is fixed in **Zebra 4.3.1**. \n\nThe fix changes the `max_allocation()` method for the relevant types to return 1,000, thus blocking larger values prior to deserialization.\n\n## Mitigation\n\nUsers should upgrade to **Zebra 4.3.1** or later immediately. \n\nThere are no known workarounds for this issue. Immediate upgrade is the only way to ensure the node remains not vulnerable to the denial of service attack.\n\n## Credits\n\nThanks @Zk-nd3r for finding and reporting the issue, and suggesting the fix.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "zebrad"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.3.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "zebra-network"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.0.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ZcashFoundation/zebra/security/advisories/GHSA-xr93-pcq3-pxf8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40881"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ZcashFoundation/zebra"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-18T00:42:05Z",
    "nvd_published_at" : "2026-04-21T20:17:01Z"
  }
}