Headline
CVE-2023-24823: gnrc_sixlowpan: Various hardening fixes [backport 2022.10] by miri64 · Pull Request #18820 · RIOT-OS/RIOT
RIOT-OS, an operating system that supports Internet of Things devices, contains a network stack with the ability to process 6LoWPAN frames. Prior to version 2022.10, an attacker can send a crafted frame to the device resulting in a type confusion between IPv6 extension headers and a UDP header. This occurs while encoding a 6LoWPAN IPHC header. The type confusion manifests in an out of bounds write in the packet buffer. The overflow can be used to corrupt other packets and the allocator metadata. Corrupting a pointer will easily lead to denial of service. While carefully manipulating the allocator metadata gives an attacker the possibility to write data to arbitrary locations and thus execute arbitrary code. Version 2022.10 fixes this issue. As a workaround, apply the patches manually.
@@ -1613,16 +1613,7 @@ static gnrc_pktsnip_t *_iphc_encode(gnrc_pktsnip_t *pkt, else { dispatch->next = ptr; } if (ptr->type == GNRC_NETTYPE_UNDEF) { /* most likely UDP for now so use that (XXX: extend if extension * headers make problems) */ dispatch_size += sizeof(udp_hdr_t); break; /* nothing special after UDP so quit even if more UNDEF * come */ } else { dispatch_size += ptr->size; } dispatch_size += ptr->size; dispatch = ptr; /* use dispatch as temporary point for prev */ ptr = ptr->next; }