CVE-2025-65498
📋 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
- OISM libcoap
📦 What is this software?
Libcoap by Libcoap
⚠️ 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.
🎯 Exploit Status
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
allTemporarily disable DTLS functionality in libcoap configuration if not required
Modify libcoap configuration to disable DTLS support
Network filtering
linuxBlock 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")