VAITP Dataset

← Back to the dataset

CVE-2024-30686

Remote code execution via ROS2 Iron Irwini packages/nodes (disputed).

  • CWE-494 (inferred)
  • Authentication, Authorization, and Session Management
  • Remote

An issue was discovered in ROS2 Iron Irwini versions ROS_VERSION 2 and ROS_PYTHON_VERSION 3, allows remote attackers to execute arbitrary code via packages or nodes within the ROS2 system. NOTE: this is disputed by multiple third parties who believe there was not reasonable evidence to determine the existence of a vulnerability.

CWE
CWE-494 (inferred)
Published
2024-04-09
OWASP
A08 Software and Data Integrity Failures
Orthogonal defect classification
Interface
Code defect classification
Incorrect Interface
Category
Authentication, Authorization, and Session Management
Subcategory
Privilege Escalation
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
ROS2

Solution

Upgrade ROS 2 to the latest Iron Irwini release (≥ 2.2.0), which contains the fix for this issue.

Vulnerable code sample

import rclpy
from rclpy.node import Node

def create_node_from_name(node_name: str) -> Node:
    # VULNERABLE: uses eval on untrusted input to instantiate node class
    NodeClass = eval(node_name)  # noqa: S307
    return NodeClass(node_name)

def main():
    rclpy.init()
    node = create_node_from_name("MyNode")
    rclpy.spin(node)
    rclpy.shutdown()

Patched code sample

import rclpy
from rclpy.node import Node

def create_node_from_name(node_name: str) -> Node:
    # FIX: use a safe mapping instead of eval
    allowed_nodes = {
        "MyNode": MyNode,
    }
    NodeClass = allowed_nodes.get(node_name)
    if NodeClass is None:
        raise ValueError("Unsupported node type")
    return NodeClass(node_name)

class MyNode(Node):
    def __init__(self, name):
        super().__init__(name)

def main():
    rclpy.init()
    node = create_node_from_name("MyNode")
    rclpy.spin(node)
    rclpy.shutdown()

Cite this entry

@misc{vaitp:cve202430686,
  title        = {{Remote code execution via ROS2 Iron Irwini packages/nodes (disputed).}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2024},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2024-30686},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-30686/}}
}

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.