VAITP Dataset

← Back to the dataset

CVE-2024-30718

Remote code execution in ROS2 Dashing via malicious packages or nodes.

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

An issue was discovered in ROS2 Dashing Diademata in 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-94 (inferred)
Published
2024-04-10
OWASP
A08 Software and Data Integrity Failures
Orthogonal defect classification
Interface
Code defect classification
Missing 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 a newer, patched release (e.g., ROS 2 Foxy or any later distribution); the Dashing 2.0 release does not contain this issue.

Vulnerable code sample

import rclpy
from rclpy.node import Node

class CommandNode(Node):
    def __init__(self):
        super().__init__('command_node')
        self.declare_parameter('cmd', '')

    def execute(self):
        # VULNERABLE: executes arbitrary code from parameter
        cmd = self.get_parameter('cmd').get_parameter_value().string_value
        result = eval(cmd)  # noqa: S307
        self.get_logger().info(f'Executed result: {result}')

def main(args=None):
    rclpy.init(args=args)
    node = CommandNode()
    node.execute()
    rclpy.shutdown()

Patched code sample

import rclpy
from rclpy.node import Node
import ast

class CommandNode(Node):
    def __init__(self):
        super().__init__('command_node')
        self.declare_parameter('cmd', '')

    def execute(self):
        # FIX: safely parse expression without executing code
        cmd = self.get_parameter('cmd').get_parameter_value().string_value
        result = ast.literal_eval(cmd)
        self.get_logger().info(f'Executed result: {result}')

def main(args=None):
    rclpy.init(args=args)
    node = CommandNode()
    node.execute()
    rclpy.shutdown()

Cite this entry

@misc{vaitp:cve202430718,
  title        = {{Remote code execution in ROS2 Dashing via malicious packages or nodes.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2024},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2024-30718},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-30718/}}
}

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.