CVE-2025-65498

4.3 MEDIUM

📋 TL;DR

A NULL pointer dereference vulnerability in OISM libcoap's DTLS implementation allows remote attackers to crash the application via a specially crafted DTLS handshake. This affects systems using libcoap 4.3.5 with DTLS enabled. The vulnerability causes denial of service but does not allow code execution.

💻 Affected Systems

Products:
  • OISM libcoap
Versions: Version 4.3.5 specifically
Operating Systems: All operating systems where libcoap 4.3.5 is installed
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems with DTLS enabled in libcoap configuration. Systems using only CoAP without DTLS are not vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Application crashes completely, causing service disruption until restarted. No remote code execution or data compromise is possible.

🟠

Likely Case

Service interruption affecting CoAP/DTLS functionality, requiring manual restart of affected services.

🟢

If Mitigated

Minimal impact if proper network segmentation and monitoring are in place to detect and respond to crashes.

🌐 Internet-Facing: MEDIUM - Internet-facing CoAP/DTLS services are vulnerable to DoS attacks from unauthenticated remote attackers.
🏢 Internal Only: LOW - Internal-only CoAP/DTLS services have lower exposure but could still be targeted by internal threats.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires sending a crafted DTLS handshake to trigger the NULL pointer dereference. No authentication is required.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Fixed in libcoap 4.3.6 and later

Vendor Advisory: https://github.com/obgm/libcoap/pull/1750

Restart Required: Yes

Instructions:

1. Update libcoap to version 4.3.6 or later. 2. Recompile any applications using libcoap. 3. Restart affected services.

🔧 Temporary Workarounds

Disable DTLS

all

Temporarily disable DTLS functionality in libcoap configuration if not required

Modify libcoap configuration to disable DTLS support

Network filtering

linux

Block DTLS handshake packets at network perimeter

iptables -A INPUT -p udp --dport 5684 -j DROP
firewall-cmd --permanent --add-rich-rule='rule protocol value="udp" port port="5684" drop'

🧯 If You Can't Patch

  • Implement network segmentation to isolate CoAP/DTLS services from untrusted networks
  • Deploy monitoring and automated restart mechanisms to detect and recover from crashes

🔍 How to Verify

Check if Vulnerable:

Check libcoap version: dpkg -l | grep libcoap or rpm -qa | grep libcoap. If version is exactly 4.3.5 and DTLS is enabled, system is vulnerable.

Check Version:

pkg-config --modversion libcoap-3 || find /usr -name "*libcoap*" -exec strings {} \; | grep -i version

Verify Fix Applied:

Verify libcoap version is 4.3.6 or later and test DTLS handshake functionality

📡 Detection & Monitoring

Log Indicators:

  • Application crash logs mentioning coap_dtls_generate_cookie
  • Segmentation fault errors in libcoap processes
  • Unexpected service restarts of CoAP applications

Network Indicators:

  • Unusual DTLS handshake patterns to port 5684
  • Multiple failed DTLS connections from single source

SIEM Query:

source="application.logs" AND ("segmentation fault" OR "null pointer" OR "coap_dtls")

🔗 References

📤 Share & Export