CVE-2026-10773
Beschrijving NL
De DHCPv4-clienthelper net_dhcpv4_msg_type_name() in subsys/net/lib/dhcpv4/dhcpv4.c indexeert een statische 8-elementen const. char * naamtabel na een foutieve grenscontrole. De guard gebruikte msg_type <= sizeof(name) in plaats van msg_type <= ARRAY_SIZE(name); sizeof retourneert de bytegrootte van de pointer-array (32 op 32-bits, 64 op 64-bits doelen) in plaats van het aantal elementen van 8, dus berichttypewaarden van 9 tot die bytegrootte passeren de controle en zorgen ervoor dat naam[msg_type - 1] voorbij het einde van de array leest. De msg_type waarde is afkomstig van de DHCP BERICHTTYPE optie, die wordt gelezen als een ongecontroleerde ruwe byte van een ontvangen pakket (net_pkt_read_u8) en ongewijzigd wordt doorgegeven aan de lookup. Een DHCP-server of een host die in staat is om een vervalst DHCP-antwoord op de link van de klant te injecteren, kan de index daarom buiten de perken houden. De out-of-range slot levert een garbage const char * op die vervolgens wordt gederefereerd door een %s logconversie. De lookup wordt alleen bereikt vanuit een debug log-instructie (NET_DBG / LOG_DBG), dus de out-of-bounds read kan alleen worden geactiveerd wanneer de DHCPv4-logmodule is gebouwd op DEBUG-NIVEAU (CONFIG_net_DHCPV4_LOG_LEVEL_DBG), wat niet de standaardconfiguratie is. Wanneer die voorwaarde van toepassing is, is het resultaat een buiten de grenzen gelezen en een wild-pointer-dereferentie: hoogstwaarschijnlijk een crash van de DHCP-client (denial of service) en mogelijk openbaarmaking van de inhoud van een aangrenzende aanwijzer via de logboekuitvoer. De fix vervangt sizeof door ARRAY_SIZE en herstelt het juiste acceptatievenster van 1..8.
Origineel (Engels) tonen
The DHCPv4 client helper net_dhcpv4_msg_type_name() in subsys/net/lib/dhcpv4/dhcpv4.c indexes a static 8-element const char * name table after a faulty bounds check. The guard used msg_type <= sizeof(name) instead of msg_type <= ARRAY_SIZE(name); sizeof returns the byte size of the pointer array (32 on 32-bit, 64 on 64-bit targets) rather than the element count of 8, so message-type values from 9 up to that byte size pass the check and cause name[msg_type - 1] to read past the end of the array.
The msg_type value originates from the DHCP MESSAGE TYPE option, which is read as an unchecked raw byte from a received packet (net_pkt_read_u8) and passed unmodified into the lookup. A DHCP server, or any host able to inject a spoofed DHCP reply onto the client's link, can therefore drive the index out of bounds. The out-of-range slot yields a garbage const char * that is then dereferenced by a %s log conversion.
The lookup is reached only from a debug log statement (NET_DBG / LOG_DBG), so the out-of-bounds read is triggerable only when the DHCPv4 log module is built at DEBUG level (CONFIG_NET_DHCPV4_LOG_LEVEL_DBG), which is not the default configuration. When that condition holds, the result is an out-of-bounds read and a wild-pointer dereference: most likely a crash of the DHCP client (denial of service) and potentially disclosure of an adjacent pointer's contents through the log output. The fix replaces sizeof with ARRAY_SIZE, restoring the correct 1..8 acceptance window.