Executive brief
ccoap is a CoAP (Constrained Application Protocol) library used in IoT and embedded systems to enable lightweight network communication. A flaw in the option parsing logic causes the library to crash when it receives malformed messages, potentially allowing attackers to deny service to any device or application using ccoap for CoAP communications.
Technical details
The vulnerability is a use-of-uninitialized-memory / invalid-memory-access bug in the coap_decode_option() function. When parsing COAP message options, the function allocates an option list via malloc() without initializing it, then partially initializes option structures. If option data is insufficient, it breaks from the parse loop before allocating memory for the data pointers, leaving them uninitialized (containing garbage). The cleanup function coap_clean_options() later attempts to free these uninitialized pointers, causing a segmentation fault. The attack requires sending a malformed COAP message to an application using the vulnerable library; no authentication or special privileges are needed. An attacker on the network can trigger a denial of service by crashing any service using ccoap.
Affected products
- ipflavors ccoap commit 77f55c4b466e99327c24ace8a2913d3ba7e2ccd5 and prior
Timeline
- 2026-08-27: disclosed