Headline
CVE-2022-35927: Verify DIO prefix info lengths in RPL-Classic by nvt · Pull Request #1589 · contiki-ng/contiki-ng
Contiki-NG is an open-source, cross-platform operating system for IoT devices. In the RPL-Classic routing protocol implementation in the Contiki-NG operating system, an incoming DODAG Information Option (DIO) control message can contain a prefix information option with a length parameter. The value of the length parameter is not validated, however, and it is possible to cause a buffer overflow when copying the prefix in the set_ip_from_prefix function. This vulnerability affects anyone running a Contiki-NG version prior to 4.7 that can receive RPL DIO messages from external parties. To obtain a patched version, users should upgrade to Contiki-NG 4.7 or later. There are no workarounds for this issue.
@@ -447,6 +447,14 @@ dio_input(void) goto discard; } dio.prefix_info.length = buffer[i + 2];
if(dio.prefix_info.length > sizeof(uip_ipaddr_t) * 8) { LOG_WARN("Invalid DAG prefix info, len %u > %u\n", dio.prefix_info.length, (unsigned)(sizeof(uip_ipaddr_t) * 8)); RPL_STAT(rpl_stats.malformed_msgs++); goto discard; }
dio.prefix_info.flags = buffer[i + 3]; /* valid lifetime is ingnored for now - at i + 4 */ /* preferred lifetime stored in lifetime */