{"id":"CVE-2024-42002","state":"PUBLISHED","title":"Unsafe use of eval() method in ros2 topic hz tool","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.","publishedAt":"2026-09-28T21:38:08.369Z","updatedAt":"2026-09-30T13:43:15.912Z","severity":{"score":8.6,"label":"High","version":"4.0","vector":"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","source":"canonical"},"assigner":"canonical","products":["Open Source Robotics Foundation Robot Operating System 2 (ROS 2)"],"affected":[{"vendor":"Open Source Robotics Foundation","product":"Robot Operating System 2 (ROS 2)","packageName":"ros2topic","defaultStatus":"unaffected","versions":[{"version":"Rolling Ridley","status":"affected","versionType":"custom"},{"version":"Lyrical Luth","status":"affected","versionType":"custom"},{"version":"Kilted Kaiju","status":"affected","versionType":"custom"},{"version":"Jazzy Jalisco","status":"affected","versionType":"custom"},{"version":"Iron Irwini","status":"affected","versionType":"custom"},{"version":"Humble Hawksbill","status":"affected","versionType":"custom"},{"version":"Galactic Geochelone","status":"affected","versionType":"custom"},{"version":"Foxy Fitzroy","status":"affected","versionType":"custom"},{"version":"Eloquent Elusor","status":"affected","versionType":"custom"},{"version":"Dashing Diademata","status":"affected","versionType":"custom"},{"version":"Crystal Clemmys","status":"affected","versionType":"custom"}],"platforms":["Linux","MacOS","Windows"],"repo":"https://github.com/ros2/ros2cli","modules":["ros2topic"],"programFiles":["ros2topic/ros2topic/verb/hz.py"]}],"references":["https://github.com/ros2/ros2cli/pull/1001","https://github.com/ros2/ros2cli/pull/133#discussion_r223081766"],"weaknesses":["CWE-95","CWE-94"],"ingestedAt":"2026-10-29T20:07:47.831Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/42xxx/CVE-2024-42002.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-42002","state":"PUBLISHED","datePublished":"2026-09-28T21:38:08.369Z","dateUpdated":"2026-09-30T13:43:15.912Z","assignerShortName":"canonical","assignerOrgId":"cc1ad9ee-3454-478d-9317-d3e869d708bc","dateReserved":"2024-08-01T12:00:12.183Z"},"containers":{"cna":{"title":"Unsafe use of eval() method in ros2 topic hz tool","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"Open Source Robotics Foundation","product":"Robot Operating System 2 (ROS 2)","packageName":"ros2topic","defaultStatus":"unaffected","versions":[{"version":"Rolling Ridley","status":"affected","versionType":"custom"},{"version":"Lyrical Luth","status":"affected","versionType":"custom"},{"version":"Kilted Kaiju","status":"affected","versionType":"custom"},{"version":"Jazzy Jalisco","status":"affected","versionType":"custom"},{"version":"Iron Irwini","status":"affected","versionType":"custom"},{"version":"Humble Hawksbill","status":"affected","versionType":"custom"},{"version":"Galactic Geochelone","status":"affected","versionType":"custom"},{"version":"Foxy Fitzroy","status":"affected","versionType":"custom"},{"version":"Eloquent Elusor","status":"affected","versionType":"custom"},{"version":"Dashing Diademata","status":"affected","versionType":"custom"},{"version":"Crystal Clemmys","status":"affected","versionType":"custom"}],"platforms":["Linux","MacOS","Windows"],"repo":"https://github.com/ros2/ros2cli","modules":["ros2topic"],"programFiles":["ros2topic/ros2topic/verb/hz.py"]}],"references":[{"url":"https://github.com/ros2/ros2cli/pull/1001","tags":["patch"]},{"url":"https://github.com/ros2/ros2cli/pull/133#discussion_r223081766","tags":["issue-tracking"]}],"metrics":[{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV4_0":{"attackVector":"LOCAL","attackComplexity":"LOW","attackRequirements":"NONE","privilegesRequired":"NONE","userInteraction":"NONE","vulnConfidentialityImpact":"HIGH","subConfidentialityImpact":"NONE","vulnIntegrityImpact":"HIGH","subIntegrityImpact":"NONE","vulnAvailabilityImpact":"HIGH","subAvailabilityImpact":"NONE","exploitMaturity":"NOT_DEFINED","Safety":"NOT_DEFINED","Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","valueDensity":"NOT_DEFINED","vulnerabilityResponseEffort":"NOT_DEFINED","providerUrgency":"NOT_DEFINED","version":"4.0","baseSeverity":"HIGH","baseScore":8.6,"vectorString":"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"}},{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV3_1":{"version":"3.1","attackVector":"LOCAL","attackComplexity":"LOW","privilegesRequired":"NONE","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"HIGH","baseSeverity":"HIGH","baseScore":8.4,"vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-95","lang":"en","description":"CWE-95 Improper neutralization of directives in dynamically evaluated code ('eval injection')","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-94","lang":"en","description":"CWE-94 Improper Control of Generation of Code ('Code Injection')","type":"CWE"}]}],"providerMetadata":{"shortName":"canonical","orgId":"cc1ad9ee-3454-478d-9317-d3e869d708bc","dateUpdated":"2026-09-28T21:38:08.369Z"},"impacts":[{"capecId":"CAPEC-242","descriptions":[{"lang":"en","value":"CAPEC-242 Code Injection"}]}],"workarounds":[{"lang":"en","value":"Do not pass untrusted or unreviewed input to the --filter option of 'ros2 topic hz'."}],"solutions":[{"lang":"en","value":"No fixed release is available at the time of publication. A fix is proposed upstream in https://github.com/ros2/ros2cli/pull/1001."}],"credits":[{"lang":"en","value":"Florencia Cabral Berenfus, Ubuntu Robotics Team","type":"finder"}],"source":{"discovery":"INTERNAL"},"x_generator":{"engine":"cvelib 1.8.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-09-30T13:43:08.696167Z","id":"CVE-2024-42002","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-09-30T13:43:15.912Z"}}]}}}