Description
libcoap versions up to and including 4.3.5, prior to commit 30db3ea, contain a stack-based buffer overflow in address resolution when attacker-controlled hostname data is copied into a fixed 256-byte stack buffer without proper bounds checking. A remote attacker can trigger a crash and potentially achieve remote code execution depending on compiler options and runtime memory protections. Exploitation requires the proxy logic to be enabled (i.e., the proxy request handling code path in an application using libcoap).
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| libcoap | libcoap | ≤ 4.3.5 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | libcoap3 | 4.3.5-3 | — |
| Debian 13 | libcoap3 | 4.3.4-1.1+deb13u3 | — |
| Debian 12 | libcoap3 | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | libcoap3 | No fix yet | — |
| Ubuntu 26.04 LTS | libcoap3 | No fix yet | — |
| Ubuntu 25.10 | libcoap3 | No fix yet | — |
| Ubuntu 24.04 LTS | libcoap3 | No fix yet | — |
| Ubuntu 22.04 LTS | libcoap2 +1 | No fix yet | — |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 20.04 LTS | libcoap2 | No fix yet | — |
| Ubuntu 18.04 LTS | libcoap | No fix yet | — |
References
- https://github.com/obgm/libcoap/pull/1737 issue-tracking patch
- https://github.com/obgm/libcoap/commit/30db3ea patch
- https://libcoap.net/ product
- https://www.vulncheck.com/advisories/libcoap-stack-based-buffer-overflow-in-address-resolution-dos-or-potential-rce third-party-advisory