CVE-2026-56015
Beschrijving NL
Net::IP:: LPM-versies tot en met 1.10 voor Perl laten een heap buiten de grenzen lezen via een onbegrensde prefixlengte. add() geeft de prefixstring door aan de trie builder addPrefixToTrie () zonder deze te controleren aan de hand van de adresbreedte. addPrefixToTrie () loopt vervolgens de prefixbuffer door prefix_length bits, waarbij het voorvoegsel[byte] wordt gelezen voor byte tot prefix_len/8, waarbij het voorvoegsel het 4-byte (IPv4) of 16-byte (IPv6) ingepakte adres is. Een prefixlengte groter dan 32 voor IPv4 of 128 voor IPv6, bijvoorbeeld add("1.2.3.4/255", $v) of add("2001:db8::/255", $v), leest voorbij het einde van het ingepakte adres. De out-of-bounds read gebeurt tijdens de trie constructie en is begrensd: de prefix lengte wordt opgeslagen als een unsigned char, dus de bit walk leest maximaal 32 bytes vanaf het begin van het ingepakte adres, een korte afstand voorbij het einde van de 4-byte of 16-byte buffer. Het is detecteerbaar onder AddressSanitizer, valgrind of een geharde allocator, waar het het proces kan afbreken. Lookups en dump() formatteren alleen de geldige adresbreedte, zodat de out-of-bounds bytes niet worden blootgesteld via de API van de module.
Origineel (Engels) tonen
Net::IP::LPM versions before 1.11 for Perl allow a heap out-of-bounds read via an unbounded prefix length.
add() passes the prefix string to the trie builder addPrefixToTrie() without checking it against the address width.
addPrefixToTrie() then walks the prefix buffer by prefix_length bits, reading prefix[byte] for byte up to prefix_len/8, where prefix is the 4-byte (IPv4) or 16-byte (IPv6) packed address. A prefix length greater than 32 for IPv4 or 128 for IPv6, for example add("1.2.3.4/255", $v) or add("2001:db8::/255", $v), reads past the end of the packed address.
The out-of-bounds read happens during trie construction and is bounded: the prefix length is stored as an unsigned char, so the bit walk reads at most 32 bytes from the start of the packed address, a short distance past the end of the 4-byte or 16-byte buffer. It is detectable under AddressSanitizer, valgrind, or a hardened allocator, where it can abort the process. Lookups and dump() format only the valid address width, so the out-of-bounds bytes are not exposed through the module's API.