VAITP Dataset

← Back to the dataset

CVE-2020-10289

Unsafe YAML load in ROS actionlib allows arbitrary Python object instantiation, enabling potential code execution by attackers

  • CVSS 8.8
  • CWE-502
  • Input Validation and Sanitization
  • Local

Use of unsafe yaml load. Allows instantiation of arbitrary objects. The flaw itself is caused by an unsafe parsing of YAML values which happens whenever an action message is processed to be sent, and allows for the creation of Python objects. Through this flaw in the ROS core package of actionlib, an attacker with local or remote access can make the ROS Master, execute arbitrary code in Python form. Consider yaml.safe_load() instead. Located first in actionlib/tools/library.py:132. See links for more info on the bug.

CVSS base score
8.8
Published
2020-08-20
OWASP
A06 Vulnerable and Outdated Components
Orthogonal defect classification
Function
Code defect classification
Incorrect Functionality
Category
Input Validation and Sanitization
Subcategory
Insecure Parsing or Deserialization
Accessibility scope
Local
Impact
Arbitrary Code Execution
Affected component
actionlib
Fixed by upgrading
Yes

Solution

Update ROS actionlib to use yaml.safe_load() instead.

Vulnerable code sample

import yaml

# Vulnerable code using unsafe load
yaml_string = "!!python/object/apply:os.system ['echo vulnerable']"
data = yaml.load(yaml_string)  # This is unsafe and allows arbitrary code execution

Patched code sample

import yaml

# Original unsafe load (vulnerable code)
# data = yaml.load(yaml_string)  # This is unsafe

# Fixed code using safe_load
data = yaml.safe_load(yaml_string)

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

  • Address RVD#2401 (ros/actionlib)
    actionlib_tools/scripts/library.py · yaml_msgs_str, actionlib_tools/scripts/library.py · yaml_msg_str

Cite this entry

@misc{vaitp:cve202010289,
  title        = {{Unsafe YAML load in ROS actionlib allows arbitrary Python object instantiation, enabling potential code execution by attackers}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2020},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2020-10289},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2020-10289/}}
}

Download this entry as JSON Download the whole dataset

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 ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.