CVE-2024-30687
Insecure deserialization in ROS2 Iron Irwini may allow arbitrary code execution.
- CWE-502 (inferred)
- Input Validation and Sanitization
- Remote
An insecure deserialization vulnerability has been identified in ROS2 Iron Irwini versions ROS_VERSION 2 and ROS_PYTHON_VERSION 3, allows attackers to execute arbitrary code via a crafted input to the Data Serialization and Deserialization Components, Inter-Process Communication Mechanisms, and Network Communication Interfaces. NOTE: this is disputed by multiple third parties who believe there was not reasonable evidence to determine the existence of a vulnerability.
- CWE
- CWE-502 (inferred)
- Published
- 2024-04-09
- OWASP
- A08 Software and Data Integrity Failures
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Insecure Parsing or Deserialization
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- ROS2
Solution
Upgrade to ROS 2 Iron Irwini 2.2.0 (or later), which includes the fix for the insecure‑deserialization issue. If you cannot upgrade, mitigate by disabling untrusted data deserialization and applying strict input validation.
Vulnerable code sample
import rclpy
from rclpy.node import Node
import pickle
class EchoNode(Node):
def __init__(self):
super().__init__('echo_node')
self.sub = self.create_subscription(
bytes, 'raw_data', self._callback, 10)
# VULNERABLE: using pickle.loads on untrusted input
def _callback(self, msg):
data = pickle.loads(msg) # noqa: S301
self.process(data)
def process(self, data):
# placeholder for handling the deserialized object
passPatched code sample
import rclpy
from rclpy.node import Node
import json
class EchoNode(Node):
def __init__(self):
super().__init__('echo_node')
self.sub = self.create_subscription(
bytes, 'raw_data', self._callback, 10)
# FIX: replace pickle with safe json deserialization
def _callback(self, msg):
try:
data = json.loads(msg.decode('utf-8'))
except json.JSONDecodeError:
self.get_logger().error('Received malformed data')
return
self.process(data)
def process(self, data):
# placeholder for handling the deserialized object
passCite this entry
@misc{vaitp:cve202430687,
title = {{Insecure deserialization in ROS2 Iron Irwini may allow arbitrary code execution.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2024},
note = {VAITP Python Vulnerability Dataset, entry CVE-2024-30687},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-30687/}}
}
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 ::
