OISM libcoap NULL Pointer Dereference Vulnerability in DTLS Handshake

Vulnerability

A NULL pointer dereference vulnerability has been identified in OISM libcoap version 4.3.5. This issue arises in the function coap_dtls_generate_cookie() within the file src/coap_openssl.c. The vulnerability allows remote attackers to cause a denial-of-service condition by crafting a DTLS handshake that leads to SSL_get_SSL_CTX() returning NULL. The improper handling of this NULL return value during DTLS cookie generation causes libcoap to pass a null pointer to SSL_CTX_get_app_data(), which then attempts to access application data using a NULL SSL_CTX pointer, resulting in a segmentation fault.

Impact

Exploitation of this vulnerability causes a segmentation fault, leading to a denial-of-service condition.

Reproduction

The vulnerability can be reproduced by sending a DTLS handshake that triggers SSL_get_SSL_CTX() to return NULL. This can be done using a DTLS client that crafts a handshake message causing the OpenSSL library to return a NULL context, which libcoap does not properly check before proceeding with cookie generation.

Remediation

Users can update to the latest version of OISM libcoap, where this vulnerability has been addressed.

Added: Nov 24, 2025, 2:21 PM
Updated: Nov 24, 2025, 7:29 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
2.5
exploitability
5.7
remediation
7.7
relevance
1.1
threat
4.8
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.