CVE-2024-31031
High · 7.5CVSS
7.5
EPSS
0.9%
Published
Apr 17, 2024
CISA due date
—
Cloudanix analysis
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
- Locate networked services that use libcoap 4.3.4 or earlier
- Craft a minimal sequence of CoAP messages that exercise the vulnerable PDU path
- Transmit the sequence over UDP or TCP to the target
- 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
- CVE-2024-46304 A NULL pointer dereference in libcoap v4.3.5-rc2 and below allows a remote attacker to… Also affects libcoap3
- CVE-2023-51847 An issue in obgm and Libcoap v.a3ed466 allows a remote attacker to cause a denial of… Also affects libcoap3
- CVE-2023-30362 Buffer Overflow vulnerability in coap_send function in libcoap library 4.3.1-103-g52cfd56… Also affects libcoap3
- CVE-2026-110264 An issue has been discovered in GitLab CE/EE affecting all versions from 7.0 before… CWE-190
- CVE-2026-53615 util-linux is a random collection of Linux utilities. CWE-190
- CVE-2026-106574 ImageMagick is free and open-source software used for editing and manipulating digital… CWE-190
- CVE-2026-106571 ImageMagick is free and open-source software used for editing and manipulating digital… CWE-190
- CVE-2026-75820 GNU Aspell contains an integer truncation vulnerability in the WritableDict::add()… CWE-190