Unsafe use of eval() method in ros2 topic hz tool
Summary
| CVE | CVE-2024-42002 |
|---|---|
| State | PUBLISHED |
| Assigner | canonical |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2026-09-28 22:17:28 UTC |
| Updated | 2026-09-30 14:17:17 UTC |
| 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. |
Risk And Classification
Primary CVSS: v4.0 8.6 HIGH from [email protected]
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/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
EPSS: 0.001600000 probability, percentile 0.044250000 (date 2026-09-29)
Problem Types: CWE-94 | CWE-95 | CWE-95 CWE-95 Improper neutralization of directives in dynamically evaluated code ('eval injection') | CWE-94 CWE-94 Improper Control of Generation of Code ('Code Injection')
| Version | Source | Type | Score | Severity | Vector |
|---|---|---|---|---|---|
| 4.0 | [email protected] | Secondary | 8.6 | HIGH | 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/E:X/C... |
| 4.0 | CNA | CVSS | 8.6 | HIGH | 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 |
| 3.1 | [email protected] | Secondary | 8.4 | HIGH | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| 3.1 | CNA | CVSS | 8.4 | HIGH | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
CVSS v4.0 Breakdown
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/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
CVSS v3.1 Breakdown
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Vendor Declared Affected Products
| Source | Vendor | Product | Version | Platforms |
|---|---|---|---|---|
| CNA | Open Source Robotics Foundation | Robot Operating System 2 ROS 2 | affected Rolling Ridley custom | Linux, MacOS, Windows |
| CNA | Open Source Robotics Foundation | Robot Operating System 2 ROS 2 | affected Lyrical Luth custom | Linux, MacOS, Windows |
| CNA | Open Source Robotics Foundation | Robot Operating System 2 ROS 2 | affected Kilted Kaiju custom | Linux, MacOS, Windows |
| CNA | Open Source Robotics Foundation | Robot Operating System 2 ROS 2 | affected Jazzy Jalisco custom | Linux, MacOS, Windows |
| CNA | Open Source Robotics Foundation | Robot Operating System 2 ROS 2 | affected Iron Irwini custom | Linux, MacOS, Windows |
| CNA | Open Source Robotics Foundation | Robot Operating System 2 ROS 2 | affected Humble Hawksbill custom | Linux, MacOS, Windows |
| CNA | Open Source Robotics Foundation | Robot Operating System 2 ROS 2 | affected Galactic Geochelone custom | Linux, MacOS, Windows |
| CNA | Open Source Robotics Foundation | Robot Operating System 2 ROS 2 | affected Foxy Fitzroy custom | Linux, MacOS, Windows |
| CNA | Open Source Robotics Foundation | Robot Operating System 2 ROS 2 | affected Eloquent Elusor custom | Linux, MacOS, Windows |
| CNA | Open Source Robotics Foundation | Robot Operating System 2 ROS 2 | affected Dashing Diademata custom | Linux, MacOS, Windows |
| CNA | Open Source Robotics Foundation | Robot Operating System 2 ROS 2 | affected Crystal Clemmys custom | Linux, MacOS, Windows |
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| github.com/ros2/ros2cli/pull/133 | [email protected] | github.com | |
| github.com/ros2/ros2cli/pull/1001 | [email protected] | github.com | |
| CVE Program record | CVE.ORG | www.cve.org | canonical |
| NVD vulnerability detail | NVD | nvd.nist.gov | canonical, analysis |
Vendor Comments And Credit
Discovery Credit
CNA: Florencia Cabral Berenfus, Ubuntu Robotics Team (en)
Additional Advisory Data
Solutions
CNA: No fixed release is available at the time of publication. A fix is proposed upstream in https://github.com/ros2/ros2cli/pull/1001.
Workarounds
CNA: Do not pass untrusted or unreviewed input to the --filter option of 'ros2 topic hz'.