CVE-2024-42002: Unsafe use of eval() method in ros2 topic hz tool
Vulnerability summary
CVE-2024-42002 is a high (CVSS 8.6) Improper Control of Generation of Code vulnerability in open source robotics foundation robot operating system 2 (ros 2). EPSS estimates a 0.16% chance of exploitation in the next 30 days, higher than 5.2% of scored vulnerabilities.
Not severe (CVSS 8.6, local access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Timeline
- 28-09-2026PublishedVulnerability first disclosed.
- 30-09-2026Last modifiedVulnerability information updated.
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 metrics
4 scores · 2 sources · 2 versions- NVDNIST8.6HighCVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
- NVDNIST8.4HighCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS trend
Probability
0.16%
Chance of exploitation in the next 30 days
Percentile
5%
Versus all other CVEs
30-day change
No change 0.00 pp
From 0.16% on 21-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root cause- CWE-94Improper Control of Generation of CodeThe 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.
- CWE-95Improper Neutralization of Directives in Dynamically Evaluated CodeThe 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").
Affected systems
Known conditions: local access, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Open source robotics foundation1 product
- robot operating system 2 (ros 2)Rolling Ridley | Lyrical Luth | Kilted Kaiju | Jazzy Jalisco | Iron Irwini | Humble Hawksbill | Galactic Geochelone | Foxy Fitzroy | Eloquent Elusor | Dashing Diademata | Crystal Clemmys
1 vendor · 1 product
References
2 links- github.com/ros2/ros2cli/pull/133Issue Tracking