CVE-2024-30703
Arbitrary file upload in ROS2 Galactic enables code exec, DoS, data leak.
- CWE-434 (inferred)
- Input Validation and Sanitization
- Remote
An arbitrary file upload vulnerability has been discovered in ROS2 (Robot Operating System 2) Galactic Geochelone ROS_VERSION 2 and ROS_PYTHON_VERSION 3, allows attackers to execute arbitrary code, cause a denial of service (DoS), and obtain sensitive information via a crafted payload to the file upload mechanism of the ROS2 system, including the server’s functionality for handling file uploads and the associated validation processes. NOTE: this is disputed by multiple third parties who believe there was not reasonable evidence to determine the existence of a vulnerability.
- CWE
- CWE-434 (inferred)
- Published
- 2024-04-09
- OWASP
- A08 Software and Data Integrity Failures
- Orthogonal defect classification
- Checking
- Code defect classification
- Incorrect Check
- Category
- Input Validation and Sanitization
- Subcategory
- Path Traversal
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- ROS2
Solution
Upgrade ROS 2 to Galactic Geochelone 2.0.1 (or any later Galactic release) where the file‑upload handling was fixed.
Vulnerable code sample
import os
from pathlib import Path
def handle_file_upload(filename: str, data: bytes):
# VULNERABLE: writes file based on user‑controlled path without validation
upload_path = Path("/var/ros2/uploads") / filename
with open(upload_path, "wb") as f:
f.write(data)Patched code sample
import os
from pathlib import Path
def handle_file_upload(filename: str, data: bytes):
# FIX: restrict path to upload directory and reject traversal attempts
base_dir = Path("/var/ros2/uploads").resolve()
upload_path = (base_dir / filename).resolve()
if not str(upload_path).startswith(str(base_dir) + os.sep):
raise ValueError("Invalid file path")
with open(upload_path, "wb") as f:
f.write(data)Cite this entry
@misc{vaitp:cve202430703,
title = {{Arbitrary file upload in ROS2 Galactic enables code exec, DoS, data leak.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2024},
note = {VAITP Python Vulnerability Dataset, entry CVE-2024-30703},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-30703/}}
}
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 ::
