CVE-2024-30665
OS command injection in ROS Melodic allowing unauthorized command execution.
- CWE-78 (inferred)
- Input Validation and Sanitization
- Remote
An OS command injection vulnerability has been discovered in ROS (Robot Operating System) Melodic Morenia in ROS_VERSION 1 and ROS_PYTHON_VERSION 3. This vulnerability primarily affects the command processing or system call components in ROS, making them susceptible to manipulation by malicious entities. Through this, unauthorized commands can be executed, leading to remote code execution (RCE), data theft, and malicious activities. The affected components include External Command Execution Modules, System Call Handlers, and Interface Scripts. NOTE: this is disputed by multiple third parties who believe there was not reasonable evidence to determine the existence of a vulnerability.
- CWE
- CWE-78 (inferred)
- Published
- 2024-04-08
- OWASP
- A03 Injection
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Command Injection
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- ROS
Solution
Upgrade ROS Melodic to the latest patch release (e.g., melodic‑desktop‑full 1.15.13) or migrate to ROS Noetic Ninjemys, which contains the fixed components.
Vulnerable code sample
import subprocess
def run_robot_command(cmd):
# VULNERABLE: directly concatenates user input into shell command
full_cmd = "rosrun my_pkg my_node " + cmd
subprocess.run(full_cmd, shell=True, check=True)Patched code sample
import subprocess
import shlex
def run_robot_command(cmd):
# FIX: safely quote user input before constructing the command
safe_cmd = shlex.quote(cmd)
full_cmd = "rosrun my_pkg my_node " + safe_cmd
subprocess.run(full_cmd, shell=True, check=True)Cite this entry
@misc{vaitp:cve202430665,
title = {{OS command injection in ROS Melodic allowing unauthorized command execution.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2024},
note = {VAITP Python Vulnerability Dataset, entry CVE-2024-30665},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-30665/}}
}
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 ::
