CVE-2024-42002
Unsafe use of eval() method in ros2 topic hz tool
- Published
- Updated
- Reserved
- Assigned by
- canonical
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.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| canonicalCNA (assigner) | 4.0 | High8.6 | 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 |
| canonicalCNA (assigner) | 3.1 | High8.4 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVDNVD · Awaiting Analysis | 4.0 | High8.6 | 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 (exploitation in 30 days)
- 0.16% · top 95% of all CVEs (4 Nov 2026)
- CISA SSVC
- Exploitation: none · Automatable: no · Technical impact: total
The list uses the assigner's score when there is one, then CISA's, then NVD's: High 8.6.
Weakness
Affected products
Open Source Robotics Foundation · Robot Operating System 2 (ROS 2)
- affected Rolling Ridley
- affected Lyrical Luth
- affected Kilted Kaiju
- affected Jazzy Jalisco
- affected Iron Irwini
- affected Humble Hawksbill
- affected Galactic Geochelone
- affected Foxy Fitzroy
- affected Eloquent Elusor
- affected Dashing Diademata
- affected Crystal Clemmys
What to do
Solution: No fixed release is available at the time of publication. A fix is proposed upstream in https://github.com/ros2/ros2cli/pull/1001.
Workaround: Do not pass untrusted or unreviewed input to the --filter option of 'ros2 topic hz'.
References (2)
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisories (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://trackcve.app/cve/CVE-2024-42002)Record last updated .