CVE-2026-40881
JSON

6.3medium

Zebra: addr/addrv2 Deserialization Resource Exhaustion

Severity
6.3medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.27% (higher than 21% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-xr93-pcq3-pxf8

Description

ZEBRA is a Zcash node written entirely in Rust. Prior to zebrad version 4.3.0 and zebra-network version 5.0.1, 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. This vulnerability is fixed in zebrad version 4.3.0 and zebra-network version 5.0.1.

Affected

Product or packageVersionsReported by
ZcashFoundation zebrad< 4.3.1CVE List
ZcashFoundation zebra-network< 5.0.1CVE List
zebrad (crates.io)before 4.3.1GitHub Advisory Database
zebra-network (crates.io)before 5.0.1GitHub Advisory Database
zfnd zebra-networkbefore 5.0.1NVD
zfnd zebradbefore 4.3.1NVD

All scores

GitHub_M6.3medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:L
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:L
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-770

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

ZEBRA is a Zcash node written entirely in Rust. Prior to zebrad version 4.3.0 and zebra-network version 5.0.1, 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. This vulnerability is fixed in zebrad version 4.3.0 and zebra-network version 5.0.1.

GitHub Advisory Database

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.

NVD (es)

ZEBRA es un nodo Zcash escrito completamente en Rust. Antes de la versión 4.3.0 de zebrad y la versión 5.0.1 de zebra-network, al deserializar mensajes addr o addrv2, que contienen vectores de direcciones, Zebra los deserializaría completamente hasta una longitud máxima (más de 233.000) que se derivaba del límite de tamaño de mensaje de 2 MiB. Esto es mucho mayor que el límite real de 1.000 mensajes de la especificación. Zebra eventualmente verificaría ese límite pero, en ese momento, la memoria para el vector más grande ya estaba asignada. Un atacante podría causar abortos por falta de memoria en Zebra al enviar múltiples mensajes de este tipo a través de diferentes conexiones. Esta vulnerabilidad está corregida en la versión 4.3.0 de zebrad y la versión 5.0.1 de zebra-network.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-40881 changed 2026-04-21CVE Terms of Use
GitHub Advisory DatabaseGHSA-xr93-pcq3-pxf8 changed 2026-05-05CC-BY-4.0
NVDCVE-2026-40881 changed 2026-10-26Public domain