CVE-2026-118614
Remote code execution via unsanitized input in Ultralytics' check_det_dataset.
- CVSS 7.8
- CWE-94
- Input Validation and Sanitization
- Remote
Ultralytics check_det_dataset Code Injection Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Ultralytics. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file. The specific flaw exists within the check_det_dataset function. The issue results from the lack of proper validation of a user-supplied string before using it to execute Python code. An attacker can leverage this vulnerability to execute code in the context of the current user. Was ZDI-CAN-30119.
- CWE
- CWE-94
- CVSS base score
- 7.8
- Published
- 2026-10-28
- OWASP
- A03 Injection
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Command Injection
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- Ultralytics
- Fixed by upgrading
- Yes
Solution
Upgrade Ultralytics to version 8.2.0 or later, where the check_det_dataset code‑injection flaw (ZDI‑CAN‑30119) has been patched.
Vulnerable code sample
import os
import json
def check_det_dataset(dataset_path: str):
"""
Validates a detection dataset directory.
Expects a 'data.yaml' file containing a 'names' field with class names.
"""
yaml_path = os.path.join(dataset_path, "data.yaml")
if not os.path.isfile(yaml_path):
raise FileNotFoundError(f"Missing {yaml_path}")
with open(yaml_path, "r") as f:
content = f.read()
# VULNERABLE: using eval on untrusted content allows code execution
data = eval(content) # noqa: S307
if "names" not in data or not isinstance(data["names"], list):
raise ValueError("Invalid dataset: 'names' list missing")
# Further checks omitted for brevity
return data["names"]Patched code sample
import os
import json
import ast
def check_det_dataset(dataset_path: str):
"""
Validates a detection dataset directory.
Expects a 'data.yaml' file containing a 'names' field with class names.
"""
yaml_path = os.path.join(dataset_path, "data.yaml")
if not os.path.isfile(yaml_path):
raise FileNotFoundError(f"Missing {yaml_path}")
with open(yaml_path, "r") as f:
content = f.read()
# FIX: safely parse the YAML-like content using ast.literal_eval
try:
data = ast.literal_eval(content)
except (ValueError, SyntaxError):
raise ValueError("data.yaml contains invalid syntax")
if "names" not in data or not isinstance(data["names"], list):
raise ValueError("Invalid dataset: 'names' list missing")
# Further checks omitted for brevity
return data["names"]Cite this entry
@misc{vaitp:cve2026118614,
title = {{Remote code execution via unsanitized input in Ultralytics' check_det_dataset.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-118614},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-118614/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
