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.
Published: 2026-09-28
Score: 8.6 High
EPSS: < 1% Very Low
KEV: No
Impact: Local Arbitrary Code Execution
Action: Apply Workaround
AI Analysis

Impact

This vulnerability arises from the ros2topic command‑line tool of ROS 2. The --filter option accepts a Python expression that is sent straight to eval() without any input sanitisation. Because of this, a user who can invoke the tool locally can inject and run arbitrary Python code on the machine executing ros2topic. The flaw therefore permits local arbitrary code execution, which could be used to compromise the entire ROS 2 node or the underlying host system. The weakness is categorized as misuse of eval, corresponding to CWE‑94 and CWE‑95.

Affected Systems

The affected vendors and products are the Open Source Robotics Foundation’s Robot Operating System 2 (ROS 2). All ROS 2 distributions from Crystal Clemmys through to Lyrical Luth and Rolling Ridley are impacted, as the issue resides in the ros2cli client package common to those releases.

Risk and Exploitability

The CVSS base score of 8.6 marks this as a high‑severity flaw, and because the EPSS score is not available we treat its exploitation probability as unknown but still potentially significant. The vulnerability is not listed in the CISA KEV catalogue, but its local nature means the attack requires a user who can run the ros2topic command with the dangerous --filter option. An attacker can therefore inject code by passing a crafted string, and the consequence is execution of arbitrary code with the privileges of the user running the command.

Generated by OpenCVE AI on September 28, 2026 at 22:50 UTC.

Remediation

Vendor Solution

No fixed release is available at the time of publication. A fix is proposed upstream in https://github.com/ros2/ros2cli/pull/1001.


Vendor Workaround

Do not pass untrusted or unreviewed input to the --filter option of 'ros2 topic hz'.


OpenCVE Recommended Actions

  • Avoid using untrusted or unreviewed input for the --filter option of 'ros2 topic hz'.
  • Apply the pending upstream patch from PR #1001 or upgrade ROS 2 to a version that includes the fix once it is released by the Open Source Robotics Foundation.
  • If a patch is not yet available, modify your local ros2cli installation by removing the eval call or replacing it with a safe alternative, and/or restrict the use of ros2topic hz to privileged users only.

Generated by OpenCVE AI on September 28, 2026 at 22:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 29 Sep 2026 13:30:00 +0000

Type Values Removed Values Added
First Time appeared Open Source Robotics Foundation
Open Source Robotics Foundation robot Operating System 2 (ros 2)
Vendors & Products Open Source Robotics Foundation
Open Source Robotics Foundation robot Operating System 2 (ros 2)

Mon, 28 Sep 2026 21:45:00 +0000

Type Values Removed Values Added
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.
Title Unsafe use of eval() method in ros2 topic hz tool
Weaknesses CWE-94
CWE-95
References
Metrics cvssV3_1

{'score': 8.4, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 8.6, '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'}


Subscriptions

Open Source Robotics Foundation Robot Operating System 2 (ros 2)
cve-icon MITRE

Status: PUBLISHED

Assigner: canonical

Published:

Updated: 2026-09-30T13:43:15.912Z

Reserved: 2024-08-01T12:00:12.183Z

Link: CVE-2024-42002

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-09-28T22:17:28.617

Modified: 2026-09-30T14:17:17.913

Link: CVE-2024-42002

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-09-29T13:20:09Z

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

  • CWE-95

    Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')