VAITP Dataset

← Back to the dataset

CVE-2026-84202

Unsafe PyYAML loader enables arbitrary code execution via malicious model config.

  • CVSS 8.7
  • 502
  • Input Validation and Sanitization
  • Remote

ModelScope uses PyYAML's unsafe yaml.Loader to parse model configuration files, allowing arbitrary code execution through Python object construction tags. Attackers can craft malicious model repositories with poisoned configuration files that execute code when loaded by users.

CWE
502
CVSS base score
8.7
Published
2026-09-01
OWASP
A08 Software and Data Integrity Failures
Orthogonal defect classification
Interface
Code defect classification
Missing Check
Category
Input Validation and Sanitization
Subcategory
Insecure Parsing or Deserialization
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
PyYAML
Fixed by upgrading
Yes

Solution

Upgrade ModelScope to a version that replaces yaml.Loader with yaml.safe_load (e.g., v1.9.0 or later), and ensure all configuration files are parsed with yaml.safe_load to prevent unsafe object construction.

Vulnerable code sample

import yaml

def load_model_config(path: str) -> dict:
    """Load a ModelScope model configuration file."""
    with open(path, 'r') as f:
        # VULNERABLE: using unsafe yaml.Loader allows arbitrary object construction
        config = yaml.load(f, Loader=yaml.Loader)
    return config

Patched code sample

import yaml

def load_model_config(path: str) -> dict:
    """Load a ModelScope model configuration file."""
    with open(path, 'r') as f:
        # FIX: use safe_loader to prevent object construction
        config = yaml.safe_load(f)
    return config

Payload

__VAITP_MODEL_REFUSED__

Cite this entry

@misc{vaitp:cve202684202,
  title        = {{Unsafe PyYAML loader enables arbitrary code execution via malicious model config.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-84202},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-84202/}}
}
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 ::