CVE-2024-30672
Arbitrary file upload in ROS Melodic allows code exec, DoS, data theft.
- CWE-434 (inferred)
- Input Validation and Sanitization
- Remote
Arbitrary file upload vulnerability in ROS (Robot Operating System) Melodic Morenia in ROS_VERSION 1 and ROS_PYTHON_VERSION 3, allows attackers to execute arbitrary code, cause a denial of service (DoS), and obtain sensitive information via the file upload component. 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-08
- OWASP
- A08 Software and Data Integrity Failures
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Path Traversal
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- ROS
Solution
Upgrade ROS Melodic to ROS Noetic (or a newer supported ROS 1 distribution) which includes the fix for the arbitrary file‑upload issue.
Vulnerable code sample
import os
from flask import Flask, request
app = Flask(__name__)
UPLOAD_DIR = "/var/www/uploads"
def save_file():
# VULNERABLE: writes user‑provided path without validation
filename = request.args.get('filename')
data = request.get_data()
with open(os.path.join(UPLOAD_DIR, filename), 'wb') as f:
f.write(data)Patched code sample
import os
from flask import Flask, request
from werkzeug.utils import secure_filename
app = Flask(__name__)
UPLOAD_DIR = "/var/www/uploads"
def save_file():
# FIX: sanitizes filename to prevent path traversal
raw_name = request.args.get('filename')
filename = secure_filename(raw_name)
data = request.get_data()
with open(os.path.join(UPLOAD_DIR, filename), 'wb') as f:
f.write(data)Cite this entry
@misc{vaitp:cve202430672,
title = {{Arbitrary file upload in ROS Melodic allows code exec, DoS, data theft.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2024},
note = {VAITP Python Vulnerability Dataset, entry CVE-2024-30672},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-30672/}}
}
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 ::
