CVE-2024-42002Unsafe use of eval() method in ros2 topic hz tool
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.
What to do
None of the Linux distributions or Windows releases we track list an affected package for this CVE. Check the vendor-reported products below.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
What the vendor says
As published in the CVE record by canonical, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- Open Source Robotics Foundation Robot Operating System 2 (ROS 2): affected: Rolling Ridley, Lyrical Luth, Kilted Kaiju, Jazzy Jalisco, Iron Irwini, Humble Hawksbill
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'.
Vendor advisories:
References
- https://github.com/ros2/ros2cli/pull/1001
- https://github.com/ros2/ros2cli/pull/133#discussion_r223081766
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.