---
title: "CVE-2024-42002: Robot Operating System 2 - Command Injection"
description: "Robot Operating System 2 (ROS 2) <= Rolling Ridley contains a command injection caused by unsanitized user input passed to eval() in the 'hz' verb of ros2topic, letting local users execute arbitrary code, exploit requires local access."
url: https://panop.io/threat-heartbeat/CVE-2024-42002/
---

# CVE-2024-42002 Robot Operating System 2 - Command Injection

Robot Operating System 2 (ROS 2) <= Rolling Ridley contains a command injection caused by unsanitized user input passed to eval() in the 'hz' verb of ros2topic, letting local users execute arbitrary code, exploit requires local access.

CVSS base score 8.4 /10

High

CISA KEV

Not listed

Public exploit

None known

Authentication

Not required

EPSS

0.16% chance of exploitation in 30 days

[View the NVD record ↗](https://nvd.nist.gov/vuln/detail/CVE-2024-42002)

## Details

Type

Command Injection

Impact

Remote Code Execution

CVSS vector

CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Published

28 September 2026

Updated

15 October 2026

Weakness

[CWE-94](https://cwe.mitre.org/data/definitions/94.html)

## Vendor fix

Update to the latest ROS 2 distribution beyond Rolling Ridley.

Patching closes this CVE. It does not tell you which of your systems run the affected version, or what else is exposed alongside them.

## References

- [https://nvd.nist.gov/vuln/detail/CVE-2024-42002](https://nvd.nist.gov/vuln/detail/CVE-2024-42002)
- [https://github.com/ros2/ros2cli/pull/1001](https://github.com/ros2/ros2cli/pull/1001)
- [https://github.com/ros2/ros2cli/pull/133#discussion\_r223081766](https://github.com/ros2/ros2cli/pull/133#discussion_r223081766)

[← All CVEs](https://panop.io/threat-heartbeat/)

## What this record can't tell you

- Whether you run the affected software, and where
- Whether an attacker can actually reach and exploit it
- The misconfigurations that never get a CVE number
- What it would cost the business, ranked into what to fix first

Panop answers these inside your environment, for this CVE and every other finding.

[Book a demo](https://panop.io/demo)
