CVE-2026-40881: Zebra Remote Code Execution Vulnerability
MODERATECVE-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
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.
Upgrade zebrad to 4.3.1
Upgrade zebra-network to 5.0.1
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 Affected Zebra Versions
2 component(s)| 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?
Which Zebra versions are affected?
What version fixes CVE-2026-40881?
Is zebrad affected?
Is zebra-network affected?
What CWE is associated with CVE-2026-40881?
How can I check crates.io dependencies for CVE-2026-40881?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}