Skip to main content

Libcoap CVE-2026-29013

| EUVDEUVD-2026-23535 HIGH
Out-of-bounds Read (CWE-125)
2026-04-17 VulnCheck
8.8
CVSS 4.0 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Send crafted CoAP request with malformed OSCORE option
  2. Delivery
    Trigger CBOR unwrapping in get_byte_inc()
  3. Exploit
    Bypass removed assert() bounds check
  4. Install
    Execute out-of-bounds heap read
  5. C2
    Trigger integer wraparound in allocation size
  6. Execute
    Overwrite heap metadata or adjacent objects
  7. Impact
    Achieve 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

libcoap 0 <v4.3.5b

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

NVD PRIMARY 8.8 HIGH
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
SUSE HIGH

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
Low
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch released
Apr 17, 2026 - 21:45 nvd
Patch available
CVE Published
Apr 17, 2026 - 21:11 nvd
HIGH 8.8

DescriptionCVE.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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.0%
Top 90% exploitable
Social Media
1
Sightings
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor CIRCL GitHub VulDB

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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.

CVE-2024-0962 HIGH POC
7.8 Jan 27

A vulnerability was found in obgm libcoap 4.3.4. Rated high severity (CVSS 7.8), this vulnerability is low attack comple

CVE-2024-31031 HIGH POC
7.5 Apr 17

An issue in `coap_pdu.c` in libcoap 4.3.4 allows attackers to cause undefined behavior via a sequence of messages leadin

CVE-2023-30362 HIGH POC
7.5 Jun 23

Buffer Overflow vulnerability in coap_send function in libcoap library 4.3.1-103-g52cfd56 fixed in 4.3.1-120-ge242200 al

CVE-2023-35862 MEDIUM POC
6.5 Jun 19

libcoap 4.3.1 contains a buffer over-read via the function coap_parse_oscore_conf_mem at coap_oscore.c. Rated medium sev

CVE-2025-34468 HIGH
8.2 Dec 31

Availability loss and potential remote code execution in libcoap (versions up to and including 4.3.5, before commit 30db

CVE-2025-59391 MEDIUM
6.5 Dec 08

A memory disclosure vulnerability exists in libcoap's OSCORE configuration parser in libcoap before release-4.3.5-patche

CVE-2025-65501 MEDIUM
4.3 Nov 24

Null pointer dereference in coap_dtls_info_callback() in OISM libcoap 4.3.5 allows remote attackers to cause a denial of

CVE-2025-65500 MEDIUM
4.3 Nov 24

NULL pointer dereference in coap_dtls_generate_cookie() in src/coap_openssl.c in OISM libcoap 4.3.5 allows remote attack

CVE-2025-65499 MEDIUM
4.3 Nov 24

Array index error in tls_verify_call_back() in src/coap_openssl.c in OISM libcoap 4.3.5 allows remote attackers to cause

CVE-2025-65498 MEDIUM
4.3 Nov 24

NULL pointer dereference in coap_dtls_generate_cookie() in src/coap_openssl.c in OISM libcoap 4.3.5 allows remote attack

CVE-2025-65497 MEDIUM
4.3 Nov 24

NULL pointer dereference in coap_dtls_generate_cookie() in src/coap_openssl.c in OISM libcoap 4.3.5 allows remote attack

CVE-2025-65496 MEDIUM
4.3 Nov 24

NULL pointer dereference in coap_dtls_generate_cookie() in src/coap_openssl.c in OISM libcoap 4.3.5 allows remote attack

Vendor StatusVendor

SUSE

Severity: High
Product Status
openSUSE Tumbleweed Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy