/

CVE-2026-84202

Severity:

HIGH RISK

(8.8)

Unsafe YAML Deserialization (CWE-502) in ModelScope Loader

CVE-2026-84202

Deferred

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

Arbitrary Code Execution

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

ModelScope uses PyYAML's unsafe loader to parse model configuration files, allowing specially crafted YAML to instantiate arbitrary Python objects.

When a user loads a model repository containing a poisoned configuration file, the embedded objects may execute code with the user's process privileges.

Affected context

The vulnerability occurs in ModelScope workflows that load model repositories and parse configuration files with PyYAML's unsafe yaml.Loader. Risk is higher when users obtain models from untrusted or insufficiently reviewed repositories and the configuration is processed automatically during model loading.

Exploit preconditions

  • Attack surface: Model repository configuration parsing
  • Required access: The attacker must be able to publish or modify a model repository or configuration consumed by a target
  • Trigger point: Model configuration loading by a user's ModelScope process
  • Why exploitation is possible: Unsafe YAML object-construction tags can cause attacker-controlled Python objects to be instantiated during parsing

Why this happens

The underlying bug is the use of a general-purpose YAML loader that permits Python object construction from untrusted input. Deserialization therefore interprets attacker-controlled configuration content as executable object definitions rather than as inert data. This behavior maps to CWE-502: Deserialization of Untrusted Data.

Potential impact

  • An attacker may execute arbitrary code in the ModelScope process
  • Malicious code could access local files, credentials, or environment variables
  • The affected user account or development environment could be compromised
  • Model artifacts or downstream data could be modified or poisoned
  • Compromise could enable further access to connected services, depending on permissions

General mitigation guidance

Mitigation generally focuses on removing executable behavior from model configuration parsing and reducing trust in repository content.

Common defensive patterns include:

  • Use safe or restricted YAML loaders that support only the required data types
  • Apply strict schemas and reject unexpected tags or object constructors
  • Treat model repositories and configuration files as untrusted inputs
  • Review and verify repository provenance before loading models
  • Run model-processing workflows with least-privilege accounts and isolated environments
  • Limit access to secrets, sensitive files, and network resources from model-loading processes

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules identifying yaml.load calls with unsafe or unrestricted loaders
  • Code review checks for YAML parsing of repository-controlled files
  • Dependency and policy scans that flag unsafe deserialization APIs
  • Runtime monitoring for unexpected child processes, file access, or outbound connections during model loading
  • Repository controls that require provenance, review, and integrity validation for model configuration files

Automated code review tools can help identify unsafe parser usage before deployment.

Sources

SourceLink
github.comgithub.com/modelscope/modelscope
github.comgithub.com/modelscope/modelscope/blob/v1.40.0/modelscope/models/audio/tts/voice.py
github.comgithub.com/modelscope/modelscope/blob/v1.40.0/modelscope/models/multi_modal/mplug/configuration_mplug.py
github.comgithub.com/modelscope/modelscope/issues/1660
vulncheck.comvulncheck.com/advisories/modelscope-through-1.40.0-unsafe-yaml-deserialization-in-model-config-loading

Frequently asked

questions

It can affect a user remotely through a malicious or compromised model repository, although execution occurs when the victim's environment loads the poisoned configuration.

The attacker generally needs the ability to publish, alter, or distribute a model repository or configuration that a target will load.

Parse YAML as data with a safe, restricted loader and enforce a strict schema that rejects Python object-construction tags.

Treat model repositories as untrusted, verify provenance and integrity, isolate model-processing workloads, and apply least-privilege controls to the loading process.

Find out what's already
exploitable in your codebase.