Vulnerability · Published Aug 14, 2025 · Assigned by mitre
CVE-2025-50518
Critical 9.8
In plain English
A critical-severity use-after-free in the libcoap2 package (Ubuntu). Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.5% (higher than 42% of all known vulnerabilities).
Official description
A use-after-free vulnerability exists in the coap_delete_pdu_lkd function within coap_pdu.c of the libcoap library. This issue occurs due to improper handling of memory after the freeing of a PDU object, leading to potential memory corruption or the possibility of executing arbitrary code. NOTE: this is disputed by the Supplier because it only occurs when an application uses libcoap incorrectly.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu:22.04:LTS | libcoap2 | no fix listed | UBUNTU-CVE-2025-50518 |
| Ubuntu:22.04:LTS | libcoap3 | no fix listed | UBUNTU-CVE-2025-50518 |
| Ubuntu:24.04:LTS | libcoap3 | no fix listed | UBUNTU-CVE-2025-50518 |
| Ubuntu:25.10 | libcoap3 | no fix listed | UBUNTU-CVE-2025-50518 |
| Ubuntu:26.04:LTS | libcoap3 | no fix listed | UBUNTU-CVE-2025-50518 |
| Ubuntu:26.10 | libcoap3 | no fix listed | UBUNTU-CVE-2025-50518 |
Affected products (as reported)
Weakness: CWE-416 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H