{"id":2859,"cve":"CVE-2024-30706","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2024-30706\/","cwe":"CWE-94 (inferred)","cwe_number":94,"cwe_url":null,"cvss_score":null,"published":"2024-04-09","owasp":"A01 Broken Access Control","odc":"Function","cdc":"Missing Check","category":"Authentication, Authorization, and Session Management","subcategory":"Privilege Escalation","scope":"Remote","impact":"Arbitrary Code Execution","summary":"Remote code execution in ROS2 Dashing (disputed, insufficient evidence).","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2024-30706\/","description":"An issue was discovered in ROS2 Dashing Diademata versions ROS_VERSION is 2 and ROS_PYTHON_VERSION is 3, allows remote attackers to execute arbitrary code, escalate privileges, obtain sensitive information, and gain unauthorized access to multiple ROS2 nodes. NOTE: this is disputed by multiple third parties who believe there was not reasonable evidence to determine the existence of a vulnerability.","solution":"Upgrade ROS\u202f2 to version\u202fFoxy\u202fFitzroy (or later) where the issue is resolved.","affected_component":"ROS2","fixed_by_upgrading":false,"vulnerable_code":"import rclpy\nfrom rclpy.node import Node\n\nclass CommandNode(Node):\n    def __init__(self):\n        super().__init__('command_node')\n        self.subscription = self.create_subscription(\n            String,\n            'cmd_topic',\n            self.cmd_callback,\n            10)\n\n    # VULNERABLE: uses eval on untrusted data\n    def cmd_callback(self, msg):\n        # msg.data is expected to be a Python expression\n        result = eval(msg.data)  # unsafe execution of attacker-controlled code\n        self.get_logger().info(f'Executed result: {result}')\n","patched_code":"import rclpy\nfrom rclpy.node import Node\nimport ast\n\nclass CommandNode(Node):\n    def __init__(self):\n        super().__init__('command_node')\n        self.subscription = self.create_subscription(\n            String,\n            'cmd_topic',\n            self.cmd_callback,\n            10)\n\n    # FIX: replace eval with safe literal evaluation\n    def cmd_callback(self, msg):\n        # msg.data is expected to be a literal expression\n        result = ast.literal_eval(msg.data)  # safely parse without code execution\n        self.get_logger().info(f'Executed result: {result}')\n","payload_needed":true,"payload":null,"payload_status":"model_refused","published_fix":[],"references":null}