{"id":"CVE-2020-12887","aliases":["CVE-2020-12887"],"related":[],"kind":"vulnerability","state":"published","title":"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.","summary":"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 sn_coap_parser_options_parse() 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 COAP_OPTION_URI_QUERY, COAP_OPTION_URI_PATH, COAP_OPTION_LOCATION_QUERY, and COAP_OPTION_ETAG, 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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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 sn_coap_parser_options_parse() 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 COAP_OPTION_URI_QUERY, COAP_OPTION_URI_PATH, COAP_OPTION_LOCATION_QUERY, and COAP_OPTION_ETAG, 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.","source":"cvelist"},{"lang":"es","text":"Se detectaron pérdidas de la memoria en la biblioteca CoAP en Arm Mbed OS versión 5.15.3 cuando se usa la biblioteca Arm mbed-coap versión 5.1.5. El analizador CoAP es responsable de analizar los paquetes CoAP recibidos. La función sn_coap_parser_options_parse() analiza el campo CoAP option number de todas las opciones presentes en el paquete de entrada. Cada número de opción es calculado como una suma del número de opción previo y un delta de la opción actual. El delta y el número de opción anterior son expresados como enteros de 16 bits sin signo. Debido a la falta de detección de desbordamiento, es posible crear un paquete que contenga el número de opción y resulte en que el mismo número de opción sea procesado nuevamente en un solo paquete. Determinadas opciones asignan memoria llamando a una función de asignación de memoria. En los casos de COAP_OPTION_URI_QUERY, COAP_OPTION_URI_PATH, COAP_OPTION_LOCATION_QUERY y COAP_OPTION_ETAG, no se comprueba si ya se ha asignado memoria, lo que en conjunto con el desbordamiento de enteros del número de opción puede conllevar a múltiples asignaciones de memoria asignada a un único puntero. Se ha demostrado que esto conlleva a una pérdida de memoria mediante un huérfano de búfer. Como resultado, la memoria nunca es liberada","source":"nvd"}],"published":"2020-06-18T18:24:47.000Z","modified":"2026-06-17T02:52:29.407Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:N/I:N/A:P","score":5,"rating":"MEDIUM"}],"cwes":["CWE-190","CWE-401"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"status":"affected","version":"5.1.5"}],"vendor":"arm","product":"mbed-coap","cpe":"cpe:2.3:a:arm:mbed-coap:5.1.5:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/ARMmbed/mbed-os/issues/12957","tags":["third-party-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://github.com/ARMmbed/mbed-os/issues/12930","tags":["third-party-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://github.com/mjurczak/mbed-coap/commit/4647a68e364401e81dbd370728127d844f221d93","tags":["patch","third-party-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://github.com/ARMmbed/mbed-coap/pull/116","tags":["third-party-advisory","x-refsource-confirm","x-transferred"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2020-12887","url":"https://www.cve.org/CVERecord?id=CVE-2020-12887","licence":"CVE Terms of Use","modified":"2024-08-04T12:11:18.832Z"},{"source":"nvd","name":"NVD","id":"CVE-2020-12887","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-12887","licence":"Public domain","modified":"2026-06-17T02:52:29.407Z"}],"updatedAt":"2026-11-25T22:57:53.037Z","epss":{"score":0.01733,"percentile":0.78317,"date":"2026-12-01T12:00:22.000Z"}}