CVE-2024-42002
Received Received - Intake

Code Injection in ROS 2 ros2topic Command-Line Tool

Vulnerability report for CVE-2024-42002, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-09-28

Last updated on: 2026-09-28

Assigner: Canonical Ltd.

Description

A code injection vulnerability has been discovered in the Robot Operating System 2 (ROS 2) 'ros2topic' command-line tool, affecting all ROS 2 distributions from Crystal Clemmys up to and including Lyrical Luth and Rolling Ridley. The vulnerability lies in the 'hz' verb, which reports the publishing rate of a topic and accepts a user-provided Python expression via the --filter option. This input is passed directly to the eval() function without sanitization, allowing a local user to craft and execute arbitrary code.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-09-28
Last Modified
2026-09-28
Generated
2026-09-29
AI Q&A
2026-09-29
EPSS Evaluated
N/A
NVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
openrobotics robot_operating_system From 2.0.0 (inc) to 2.3.0 (inc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-95 The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before using the input in a dynamic evaluation call (e.g. "eval").
CWE-94 The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This is a code injection vulnerability in ROS 2's 'ros2topic' tool. The 'hz' verb accepts a Python expression via the --filter option, which is passed to eval() without sanitization. This allows local users to execute arbitrary code on affected systems.

Detection Guidance

To detect this vulnerability, check if the ROS 2 'ros2topic' tool with the 'hz' verb is installed and if the --filter option is available. Run 'ros2topic hz --help' to see if the --filter option exists. If it does, the system may be vulnerable.

Impact Analysis

An attacker with local access could exploit this to run malicious code on your system, potentially stealing data, installing malware, or disrupting operations. Since it requires local access, remote exploitation is not possible.

Compliance Impact

This vulnerability could lead to unauthorized code execution, potentially violating data protection requirements under GDPR or HIPAA if sensitive data is accessed or modified. Compliance may be impacted if systems are not patched.

Mitigation Strategies

Immediately update ROS 2 to the latest patched version. Avoid using the 'hz' verb with the --filter option until a patch is applied. Restrict access to the 'ros2topic' tool to trusted users only.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2024-42002. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart