Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconSend crafted CoAP request with malformed OSCORE option
-
DeliveryTrigger CBOR unwrapping in get_byte_inc()
-
ExploitBypass removed assert() bounds check
-
InstallExecute out-of-bounds heap read
-
C2Trigger integer wraparound in allocation size
-
ExecuteOverwrite heap metadata or adjacent objects
-
ImpactAchieve memory corruption or code execution
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, read limits
MITRE ATT&CK
1 technique across 1 tactic: Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the target libcoap instance to be compiled with OSCORE support enabled and built in release mode with NDEBUG defined (removing assert checks). The OSCORE feature must be actively enabled in the running CoAP service configuration, not just compiled in. The vulnerable code path is triggered specifically during OSCORE Appendix B.2 CBOR unwrapping operations when processing incoming CoAP requests with OSCORE options or during OSCORE negotiation phase responses. Successful exploitation does NOT require the attacker to possess valid OSCORE encryption keys or pre-existing authentication credentials-the vulnerability is triggered during initial packet parsing before cryptographic validation occurs. Exploitation is limited to libcoap deployments where CoAP endpoints are network-accessible to the attacker (typically UDP ports 5683 for CoAP or 5684 for CoAPS). Deployments using libcoap without OSCORE support compiled in, or debug builds where assert() remains active, are not vulnerable. |
| Impact | Real-world risk is HIGH despite absence of confirmed active exploitation. CVSS 4.0 score of 8.8 reflects network attack vector (AV:N), low complexity (AC:L), no prerequisites (AT:N), and no authentication required (PR:N), indicating trivial exploitation against internet-facing CoAP endpoints. The high confidentiality impact (VC:H) and high availability impact (VA:H) align with memory corruption consequences-information disclosure through OOB reads and potential denial-of-service or code execution through heap overflow. EPSS data not provided, but the combination of unauthenticated network exploitation, clear vulnerable code path (commit b7847c4 shows exact fix), and widespread libcoap deployment in IoT infrastructure suggests moderate-to-high likelihood of weaponization once researchers analyze the patch diff. SSVC technical impact is TOTAL (memory corruption enabling potential RCE). The attack is AUTOMATABLE (no user interaction required, UI:N) once exploit code is developed. Primary risk differential: OSCORE is not universally enabled-only libcoap deployments using OSCORE encryption are vulnerable. Default libcoap builds without OSCORE support are NOT affected. Organizations must verify if their libcoap instances compile with OSCORE support and whether OSCORE negotiation is reachable from untrusted networks. |
| Exploit ScenarioDerived | An attacker identifies an IoT gateway running libcoap v4.3.4 with OSCORE enabled and exposed on UDP port 5684. The attacker crafts a CoAP request containing a malformed OSCORE option with manipulated CBOR-encoded length fields designed to bypass removed assert() checks. When the gateway's get_byte_inc() function processes the CBOR unwrapping during OSCORE negotiation, it reads beyond allocated buffer boundaries, leaking heap memory contents. By carefully controlling the length field to trigger integer wraparound in subsequent allocation size computation, the attacker causes a small buffer to be allocated while large data is written, achieving heap buffer overflow and potentially executing arbitrary code in the context of the CoAP service process. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 18, 2026
Out-of-bounds read in libcoap's OSCORE CBOR parsing can escalate to heap buffer overflow, enabling remote unauthenticated attackers to trigger memory corruption via malformed CoAP packets. Affects libcoap versions prior to v4.3.5b. The vulnerability stems from release builds removing assert() bounds checks in get_byte_inc(), allowing integer wraparound during allocation size computation. No public exploit identified at time of analysis, but proof-of-concept is straightforward given the specific code path and commit fix available.
RemediationAI
Upgrade libcoap to version v4.3.5b or later, which introduces proper bounds checking independent of assert() macros. The fix is available in upstream commit b7847c4dbb0dbee7c90b09a673d4cae256f03718 at https://github.com/obgm/libcoap/commit/b7847c4dbb0dbee7c90b09a673d4cae256f03718. Organizations maintaining custom libcoap builds should apply this commit and recompile with OSCORE support. If immediate patching is not feasible, implement network-level mitigations: restrict CoAP endpoint access to trusted networks only via firewall rules blocking UDP port 5684 (CoAPS) and 5683 (CoAP) from untrusted sources, or disable OSCORE support at compile time if the encryption feature is not required (trade-off: loss of end-to-end CoAP security). Application-level workaround: implement input validation to reject OSCORE options exceeding expected size thresholds before they reach libcoap parsing routines, though this requires deep protocol knowledge and may not catch all malformed inputs triggering the integer wraparound path. Note that disabling OSCORE eliminates this specific attack surface but removes message-level confidentiality and integrity protections.
Affected VersionsENISA
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
libcoap is a C implementation of the Constrained Application Protocol (CoAP, RFC 7252) used in IoT and resource-constrained devices. OSCORE (Object Security for Constrained RESTful Environments, RFC 8613) provides end-to-end encryption for CoAP messages using CBOR (Concise Binary Object Representation) encoding. The vulnerability resides in src/oscore/oscore_cbor.c's get_byte_inc() function, which performs buffer access during OSCORE Appendix B.2 CBOR unwrapping. The root cause (CWE-125: out-of-bounds read) occurs because bounds validation relies exclusively on assert() statements that are compiled out when NDEBUG is defined in production builds. This allows attackers to supply CBOR-encoded payloads that cause reads beyond allocated buffer boundaries. The secondary impact involves integer wraparound during subsequent allocation size calculations based on attacker-controlled length fields, potentially converting the read primitive into heap buffer overflow writes. Affected product: cpe:2.3:a:libcoap:libcoap:*:*:*:*:*:*:*:* versions below v4.3.5b.
Know when Libcoap gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:L/VA:H/SC:N/SI:N/SA:N
Primary rating from NVD.
CVSS VectorNVD
Lifecycle Timeline
2DescriptionCVE.org
libcoap contains out-of-bounds read vulnerabilities in OSCORE Appendix B.2 CBOR unwrap handling where get_byte_inc() in src/oscore/oscore_cbor.c relies solely on assert() for bounds checking, which is removed in release builds compiled with NDEBUG. Attackers can send crafted CoAP requests with malformed OSCORE options or responses during OSCORE negotiation to trigger out-of-bounds reads during CBOR parsing and potentially cause heap buffer overflow writes through integer wraparound in allocation size computation.
Executive ViewAI
libcoap versions prior to v4.3.5b contain a remote unauthenticated heap buffer overflow in OSCORE CBOR parsing that enables memory corruption via malformed CoAP packets, affecting any IoT or embedded device implementing this library for constrained application protocol communication. Organizations deploying libcoap in production IoT systems face potential service disruption, data exfiltration, or remote code execution if not patched immediately.
Apply vendor patch: libcoap v4.3.5b or later. If immediate patching is not feasible, implement network segmentation to restrict CoAP traffic to trusted sources only, disable OSCORE functionality if not required, and monitor for malformed CoAP packet attempts using network-based detection rules.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
A vulnerability was found in obgm libcoap 4.3.4. Rated high severity (CVSS 7.8), this vulnerability is low attack comple
An issue in `coap_pdu.c` in libcoap 4.3.4 allows attackers to cause undefined behavior via a sequence of messages leadin
Buffer Overflow vulnerability in coap_send function in libcoap library 4.3.1-103-g52cfd56 fixed in 4.3.1-120-ge242200 al
libcoap 4.3.1 contains a buffer over-read via the function coap_parse_oscore_conf_mem at coap_oscore.c. Rated medium sev
Availability loss and potential remote code execution in libcoap (versions up to and including 4.3.5, before commit 30db
A memory disclosure vulnerability exists in libcoap's OSCORE configuration parser in libcoap before release-4.3.5-patche
Null pointer dereference in coap_dtls_info_callback() in OISM libcoap 4.3.5 allows remote attackers to cause a denial of
NULL pointer dereference in coap_dtls_generate_cookie() in src/coap_openssl.c in OISM libcoap 4.3.5 allows remote attack
Array index error in tls_verify_call_back() in src/coap_openssl.c in OISM libcoap 4.3.5 allows remote attackers to cause
NULL pointer dereference in coap_dtls_generate_cookie() in src/coap_openssl.c in OISM libcoap 4.3.5 allows remote attack
NULL pointer dereference in coap_dtls_generate_cookie() in src/coap_openssl.c in OISM libcoap 4.3.5 allows remote attack
NULL pointer dereference in coap_dtls_generate_cookie() in src/coap_openssl.c in OISM libcoap 4.3.5 allows remote attack
Same weakness CWE-125 – Out-of-bounds Read
View allSame technique Buffer Overflow
View allVendor StatusVendor
SUSE
Severity: High| Product | Status |
|---|---|
| openSUSE Tumbleweed | Fixed |
EUVD-2026-23535
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB