[NCC-E005955-HV6] zebra-network
: Buffer length validation after memory allocation
#6280
Labels
zebra-network
: Buffer length validation after memory allocation
#6280
Motivation
We want to track all of the findings from the zebra audit.
Details
When deserializing a version 2 address, the length of the (variable-length) address is validated after the address is read into a buffer. An unexpectedly large address can temporarily lead to a large memory allocation on the heap. It is recommended to peek at the length of the address and validate it before reading the
addr
:zebra/zebra-network/src/protocol/external/addr/v2.rs
Lines 285 to 296 in 5a88fe7
Note that the deserialization logic ensures that the length of the
addr
vector is smaller thanMAX_U8_ALLOCATION
(currently 2097147 bytes) which is significantly higher thanMAX_ADDR_V2_ADDR_SIZE
(currently set to 512).The text was updated successfully, but these errors were encountered: