VAITP Dataset

← Back to the dataset

CVE-2024-30702

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

  • CWE-494 (inferred)
  • Design Defects
  • Remote

An issue was discovered in ROS2 Galactic Geochelone 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-494 (inferred)
Published
2024-04-09
OWASP
A06 Vulnerable and Outdated Components
Orthogonal defect classification
Interface
Code defect classification
Incorrect Interface
Category
Design Defects
Subcategory
Poorly Designed Access Controls
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
ROS2

Solution

Upgrade ROS 2 to version Galactic Geochelone 2.5.0 (or later) where the issue is patched.

Vulnerable code sample

import rclpy
from rclpy.node import Node
import importlib

class DynamicNode(Node):
    def __init__(self, node_name):
        super().__init__(node_name)
        # VULNERABLE: unsanitized import allows arbitrary code execution
        module = importlib.import_module(node_name)
        self.node_impl = module.NodeImplementation(self)

def main():
    rclpy.init()
    # Assume node_name is supplied via ROS arguments
    node_name = rclpy.parameter.Parameter('node_name', rclpy.Parameter.Type.STRING).value
    node = DynamicNode(node_name)
    rclpy.spin(node)
    rclpy.shutdown()

Patched code sample

import rclpy
from rclpy.node import Node
import importlib

ALLOWED_NODES = {'sensor_node', 'control_node'}

class DynamicNode(Node):
    def __init__(self, node_name):
        super().__init__(node_name)
        # FIX: restrict import to known safe modules
        if node_name not in ALLOWED_NODES:
            raise ValueError(f'Unauthorized node: {node_name}')
        module = importlib.import_module(node_name)
        self.node_impl = module.NodeImplementation(self)

def main():
    rclpy.init()
    node_name = rclpy.parameter.Parameter('node_name', rclpy.Parameter.Type.STRING).value
    node = DynamicNode(node_name)
    rclpy.spin(node)
    rclpy.shutdown()

Cite this entry

@misc{vaitp:cve202430702,
  title        = {{Remote code execution via ROS2 Galactic 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-30702},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-30702/}}
}

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.