CVE-2020-12887: Integer Overflow
Memory leaks were discovered in the CoAP library in Arm Mbed OS 5.15.3 when using the Arm mbed-coap library 5.1.5. The CoAP parser is responsible for parsing received CoAP packets. The function sncoapparseroptionsparse() parses the CoAP option number field of all options present in the input packet. Each option number is calculated as a sum of the previous option number and a delta of the current option. The delta and the previous option number are expressed as unsigned 16-bit integers. Due to lack of overflow detection, it is possible to craft a packet that wraps the option number around and results in the same option number being processed again in a single packet. Certain options allocate memory by calling a memory allocation function. In the cases of COAPOPTIONURIQUERY, COAPOPTIONURIPATH, COAPOPTIONLOCATIONQUERY, and COAPOPTIONETAG, there is no check on whether memory has already been allocated, which in conjunction with the option number integer overflow may lead to multiple assignments of allocated memory to a single pointer. This has been demonstrated to lead to memory leak by buffer orphaning. As a result, the memory is never freed.
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2020-12887?
CVE-2020-12887 has been classified with a moderate severity level due to the impact of memory leaks.
What software versions are affected by CVE-2020-12887?
CVE-2020-12887 affects Arm mbed-coap version 5.1.5 and Arm Mbed OS version 5.15.3.
How do I fix CVE-2020-12887?
To mitigate CVE-2020-12887, users should upgrade to a newer version of the mbed-coap library that has memory leak issues addressed.
What type of vulnerability is represented by CVE-2020-12887?
CVE-2020-12887 represents a memory leak vulnerability in the CoAP library used in specific versions of Arm Mbed OS.
Can CVE-2020-12887 lead to performance issues?
Yes, CVE-2020-12887 can lead to performance issues due to excessive memory consumption from the memory leak.