Executive brief
Contiki-NG is an operating system for Internet-of-Things devices that implements the LwM2M (Lightweight M2M) remote management protocol. A flaw in the TLV (Tag-Length-Value) parser causes it to read beyond the supplied buffer boundary, allowing an attacker to send a specially crafted CoAP message that leaks sensitive data from device memory—such as encryption keys and network peer addresses—without requiring authentication in the default NoSec mode.
Technical details
The vulnerability is a classic buffer over-read in the lwm2m_tlv_read() function (os/services/lwm2m/lwm2m-tlv.c), which ignores the caller-supplied buffer length argument and unconditionally reads up to six bytes from the input buffer. When the CoAP message ends with a TLV element containing exactly one byte, the parser reads five additional bytes from adjacent heap memory. The out-of-bounds data is returned to the caller (lwm2m-engine.c) via tlv->id, tlv->length, and tlv->value fields, disclosing memory contents including cryptographic key material and peer addresses. The attack requires only network access to the LwM2M endpoint and no authentication in NoSec mode (the default for constrained devices). A patch implementing proper bounds checking has been merged (commit f1673b5).
Affected products
- Contiki-NG Contiki-NG versions prior to commit f1673b5
Timeline
- 2026-08-06: disclosed
- 2026-08-06: patched: Fix merged as commit f1673b5 implementing bounds-check in lwm2m_tlv_read()