CVE-2024-42002

Unsafe use of eval() method in ros2 topic hz tool

Published Sep 28, 2026 CVSS 4.0 · 8.6 High EPSS < 1% KEV · Not listed
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.

Remediation

Vendor Solution

No fixed release is available at the time of publication. A fix is proposed upstream in https://github.com/ros2/ros2cli/pull/1001.


Vendor Workaround

Do not pass untrusted or unreviewed input to the --filter option of 'ros2 topic hz'.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Open Source Robotics Foundation
Open Source Robotics Foundation robot Operating System 2 (ros 2)
Vendors & Products Open Source Robotics Foundation
Open Source Robotics Foundation robot Operating System 2 (ros 2)
Type Values Removed Values Added
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.
Title Unsafe use of eval() method in ros2 topic hz tool
Weaknesses CWE-94
CWE-95
References
Metrics cvssV3_1

{'score': 8.4, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 8.6, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
canonical
Published
Updated
Sep 30, 2026, 1:43 PM
Reserved
Aug 1, 2024, 12:00 PM
Status
Awaiting Analysis
Published
Sep 28, 2026, 10:17 PM
Modified
Nov 9, 2026, 10:10 AM