VAITP Dataset

← Back to the dataset

CVE-2024-30735

Arbitrary file upload in ROS Kinetic Kame enables code execution, DoS, data leak.

  • CWE-434 (inferred)
  • Input Validation and Sanitization
  • Remote

An arbitrary file upload vulnerability has been discovered in ROS Kinetic Kame 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 crafted payload to the file upload mechanism of the ROS 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-10
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
ROS 1

Solution

Upgrade ROS Kinetic Kame to version 1.12.14 (or newer) which includes the fix for the arbitrary file‑upload issue.

Vulnerable code sample

import os
from flask import Flask, request

app = Flask(__name__)
UPLOAD_ROOT = "/var/lib/ros/uploads"

@app.route('/upload', methods=['POST'])
def upload_file():
    # VULNERABLE: unsanitized filename allows path traversal
    filename = request.files['file'].filename
    dest_path = os.path.join(UPLOAD_ROOT, filename)
    request.files['file'].save(dest_path)
    return "OK"

Patched code sample

import os
from flask import Flask, request
from werkzeug.utils import secure_filename

app = Flask(__name__)
UPLOAD_ROOT = "/var/lib/ros/uploads"

@app.route('/upload', methods=['POST'])
def upload_file():
    # FIX: sanitize filename to prevent path traversal
    raw_name = request.files['file'].filename
    filename = secure_filename(raw_name)
    dest_path = os.path.join(UPLOAD_ROOT, filename)
    request.files['file'].save(dest_path)
    return "OK"

Cite this entry

@misc{vaitp:cve202430735,
  title        = {{Arbitrary file upload in ROS Kinetic Kame enables code execution, 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-30735},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2024-30735/}}
}

Download this entry as JSON Download the whole dataset

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 ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.