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.
Moderate - This is a Denial of Service Vulnerability that could allow an attacker to crash a Zebra node.
All Zebra versions prior to version 4.3.1.
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:
addr or addrv2 messages with a large number of entries.Denial of Service
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.
Users should upgrade to Zebra 4.3.1 or later immediately.
There are no known workarounds...
5.0.14.3.1Exploitability
AV:NAC:LAT:PPR:NUI:NVulnerable System
VC:NVI:NVA:LSubsequent System
SC:NSI:NSA:L6.3/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