GHSA-7972-w7f9-3j9m: RIOT-OS has an ineffective size check that can lead to buffer overflow in link layer address filter /sys/net/link_layer/l2filter/l2filter.c
RIOT-OS, an operating system that supports Internet of Things devices, has an ineffective size check implemented with assert() can lead to buffer overflow in versions up to and including 2025.04. Assertions are usually compiled out in production builds. If assertions are the only defense against untrusted inputs, the software may be exposed to attacks that utilize the lack of proper input checks. In the l2filteradd() function shown below, addrlen is checked using an assertion and is subsequently used as an argument in a memcpy() call. When assertions are disabled, there would be no size check for addrlen. As a consequence, if an attacker were to provide an addrlen value larger than CONFIGL2FILTERADDRMAXLEN, they can trigger a buffer overflow and write past the list[i].addr buffer. If the unchecked input is attacker-controlled, the impact of the buffer overflow can range from a denial of service to arbitrary code execution. Commit f6f7de4ccc107c018630e4c15500825caf02e1c2 contains a patch for the vulnerability.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
RIOT-OSto a version that resolves this vulnerability.Patch f6f7de4ccc107c018630e4c15500825caf02e1c2