Skip to content
CVE Tracker
  • Newest CVEsPage
  • Recently added to KEVPage
  • Rising exploitation (EPSS)Page
  • Weekly digestPage
  • StatisticsPage
  • WatchlistPage
  • API documentationPage
  • Data sourcesPage
  • ChangelogPage
  • AboutPage
  • How it's builtPage
Back

CVE-2024-42002

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

High8.6EPSS 0.16%
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

CVSS scores of CVE-2024-42002, by who scored it
Scored byCVSSScoreVector
canonicalCNA (assigner)4.0High8.6CVSS: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.1High8.4CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
NVDNVD · Awaiting Analysis4.0High8.6CVSS: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
Loading the EPSS history…

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.

Badge for a README or a ticket

CVE-2024-42002 badge
[![CVE-2024-42002](https://trackcve.app/badge/CVE-2024-42002.svg)](https://trackcve.app/cve/CVE-2024-42002)

Record last updated .