Cloudanix VulnDB

CVE-2024-31031

High · 7.5

CVSS

7.5

EPSS

0.9%

Published

Apr 17, 2024

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A bug in a communication library used by many small devices can let attackers crash those devices by sending specially formatted messages.

Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
Low
Impact
Denial Of Service
Component
Library
Class
Memory Corruption
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

The flaw permits an attacker-controlled sequence of CoAP messages to trigger an unsigned integer overflow inside coap_pdu.c, producing undefined behavior that can manifest as memory corruption or process termination.

Why it matters to the business

Services built on libcoap for IoT or constrained-device messaging may experience sudden outages or unpredictable failures, interrupting device connectivity and operational workflows.

How an attack unfolds

An attacker sends a crafted series of CoAP messages to a target process linked against the vulnerable libcoap library; the messages drive the PDU parser into an integer-overflow condition that results in undefined behavior.

How to fix it

Upgrade libcoap to the first patched release that corrects the integer handling in coap_pdu.c; recompile and redeploy all dependent applications; apply vendor-supplied patches if available.

How to confirm the fix worked

Rebuild with the updated library, run existing CoAP conformance tests, and execute targeted fuzzing or static-analysis checks on coap_pdu.c to confirm absence of the overflow condition.

Typical attack path

  1. Locate networked services that use libcoap 4.3.4 or earlier
  2. Craft a minimal sequence of CoAP messages that exercise the vulnerable PDU path
  3. Transmit the sequence over UDP or TCP to the target
  4. Observe crash, memory corruption, or continued execution under undefined state

How to detect it

Correlate application crash logs or segmentation-fault reports from processes linked to libcoap with inbound CoAP traffic; look for repeated or malformed PDU patterns in network captures.

What your security team should do

  • Prioritize patching of internet-facing or high-value libcoap deployments
  • Add network controls that limit unauthenticated CoAP traffic
  • Include libcoap in the organization's software bill of materials and vulnerability monitoring
  • Test fallback to alternative CoAP implementations where feasible

The record

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

Affected packages

Ecosystem Package Introduced Fixed
Debian:12 libcoap3 0 No fix
Debian:13 libcoap3 0 No fix
Debian:14 libcoap3 0 4.3.5-1
Ubuntu:18.04:LTS libcoap 0 No fix
Ubuntu:20.04:LTS libcoap2 0 No fix
Ubuntu:22.04:LTS libcoap2 0 No fix
Ubuntu:22.04:LTS libcoap3 0 No fix
Ubuntu:24.04:LTS libcoap3 0 No fix
Ubuntu:24.10 libcoap3 0 No fix
Ubuntu:25.04 libcoap3 0 No fix
Ubuntu:25.10 libcoap3 0 No fix
Ubuntu:Pro:18.04:LTS libcoap 0 No fix
Ubuntu:Pro:20.04:LTS libcoap2 0 No fix

Related vulnerabilities