Skip to content
Heist/ feed
High

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

Type: advisorySource: Official CVE List1 source record

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.

Announced Group revision 1
Original source ↗

CVE-2024-42002

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: cve:CVE-2024-42002

Robot Operating System 2 (ROS 2)

Source reference: /containers/cna/affected/0/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "repo": "https://github.com/ros2/ros2cli",
    "vendor": "Open Source Robotics Foundation",
    "modules": [
      "ros2topic"
    ],
    "product": "Robot Operating System 2 (ROS 2)",
    "versions": [
      {
        "status": "affected",
        "version": "Rolling Ridley",
        "versionType": "custom"
      },
      {
        "status": "affected",
        "version": "Lyrical Luth",
        "versionType": "custom"
      },
      {
        "status": "affected",
        "version": "Kilted Kaiju",
        "versionType": "custom"
      },
      {
        "status": "affected",
        "version": "Jazzy Jalisco",
        "versionType": "custom"
      },
      {
        "status": "affected",
        "version": "Iron Irwini",
        "versionType": "custom"
      },
      {
        "status": "affected",
        "version": "Humble Hawksbill",
        "versionType": "custom"
      },
      {
        "status": "affected",
        "version": "Galactic Geochelone",
        "versionType": "custom"
      },
      {
        "status": "affected",
        "version": "Foxy Fitzroy",
        "versionType": "custom"
      },
      {
        "status": "affected",
        "version": "Eloquent Elusor",
        "versionType": "custom"
      },
      {
        "status": "affected",
        "version": "Dashing Diademata",
        "versionType": "custom"
      },
      {
        "status": "affected",
        "version": "Crystal Clemmys",
        "versionType": "custom"
      }
    ],
    "platforms": [
      "Linux",
      "MacOS",
      "Windows"
    ],
    "packageName": "ros2topic",
    "programFiles": [
      "ros2topic/ros2topic/verb/hz.py"
    ],
    "defaultStatus": "unaffected"
  }
]
Related CVEs
CVE-2024-42002

Source reference: /cveMetadata/cveId

Publisher severity

high

Source reference: /containers/cna/metrics

Event
#4364 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement