Refine your search

1 vulnerability found for Robot Operating System 2 (ROS 2) by Open Source Robotics Foundation

CVE-2024-42002 (GCVE-0-2024-42002)
Vulnerability from cvelistv5
Published
2026-09-28 21:38
Modified
2026-09-30 13:43
CWE
  • CWE-95 - Improper neutralization of directives in dynamically evaluated code ('eval injection')
  • CWE-94 - Improper Control of Generation of Code ('Code Injection')
Summary
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.
Impacted products
Vendor Product Version
Open Source Robotics Foundation Robot Operating System 2 (ROS 2) Version: Rolling Ridley   <
Version: Lyrical Luth   <
Version: Kilted Kaiju   <
Version: Jazzy Jalisco   <
Version: Iron Irwini   <
Version: Humble Hawksbill   <
Version: Galactic Geochelone   <
Version: Foxy Fitzroy   <
Version: Eloquent Elusor   <
Version: Dashing Diademata   <
Version: Crystal Clemmys   <
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2024-42002",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "total"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2026-09-30T13:43:08.696167Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2026-09-30T13:43:15.912Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "modules": [
            "ros2topic"
          ],
          "packageName": "ros2topic",
          "platforms": [
            "Linux",
            "MacOS",
            "Windows"
          ],
          "product": "Robot Operating System 2 (ROS 2)",
          "programFiles": [
            "ros2topic/ros2topic/verb/hz.py"
          ],
          "repo": "https://github.com/ros2/ros2cli",
          "vendor": "Open Source Robotics Foundation",
          "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"
            }
          ]
        }
      ],
      "credits": [
        {
          "lang": "en",
          "type": "finder",
          "value": "Florencia Cabral Berenfus, Ubuntu Robotics Team"
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "A code injection vulnerability has been discovered in the Robot Operating System 2 (ROS 2) \u0027ros2topic\u0027 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 \u0027hz\u0027 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."
        }
      ],
      "impacts": [
        {
          "capecId": "CAPEC-242",
          "descriptions": [
            {
              "lang": "en",
              "value": "CAPEC-242 Code Injection"
            }
          ]
        }
      ],
      "metrics": [
        {
          "cvssV4_0": {
            "Automatable": "NOT_DEFINED",
            "Recovery": "NOT_DEFINED",
            "Safety": "NOT_DEFINED",
            "attackComplexity": "LOW",
            "attackRequirements": "NONE",
            "attackVector": "LOCAL",
            "baseScore": 8.6,
            "baseSeverity": "HIGH",
            "exploitMaturity": "NOT_DEFINED",
            "privilegesRequired": "NONE",
            "providerUrgency": "NOT_DEFINED",
            "subAvailabilityImpact": "NONE",
            "subConfidentialityImpact": "NONE",
            "subIntegrityImpact": "NONE",
            "userInteraction": "NONE",
            "valueDensity": "NOT_DEFINED",
            "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",
            "version": "4.0",
            "vulnAvailabilityImpact": "HIGH",
            "vulnConfidentialityImpact": "HIGH",
            "vulnIntegrityImpact": "HIGH",
            "vulnerabilityResponseEffort": "NOT_DEFINED"
          },
          "format": "CVSS",
          "scenarios": [
            {
              "lang": "en",
              "value": "GENERAL"
            }
          ]
        },
        {
          "cvssV3_1": {
            "attackComplexity": "LOW",
            "attackVector": "LOCAL",
            "availabilityImpact": "HIGH",
            "baseScore": 8.4,
            "baseSeverity": "HIGH",
            "confidentialityImpact": "HIGH",
            "integrityImpact": "HIGH",
            "privilegesRequired": "NONE",
            "scope": "UNCHANGED",
            "userInteraction": "NONE",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "format": "CVSS",
          "scenarios": [
            {
              "lang": "en",
              "value": "GENERAL"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "cweId": "CWE-95",
              "description": "CWE-95 Improper neutralization of directives in dynamically evaluated code (\u0027eval injection\u0027)",
              "lang": "en",
              "type": "CWE"
            }
          ]
        },
        {
          "descriptions": [
            {
              "cweId": "CWE-94",
              "description": "CWE-94 Improper Control of Generation of Code (\u0027Code Injection\u0027)",
              "lang": "en",
              "type": "CWE"
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-09-28T21:38:08.369Z",
        "orgId": "cc1ad9ee-3454-478d-9317-d3e869d708bc",
        "shortName": "canonical"
      },
      "references": [
        {
          "tags": [
            "patch"
          ],
          "url": "https://github.com/ros2/ros2cli/pull/1001"
        },
        {
          "tags": [
            "issue-tracking"
          ],
          "url": "https://github.com/ros2/ros2cli/pull/133#discussion_r223081766"
        }
      ],
      "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."
        }
      ],
      "source": {
        "discovery": "INTERNAL"
      },
      "title": "Unsafe use of eval() method in ros2 topic hz tool",
      "workarounds": [
        {
          "lang": "en",
          "value": "Do not pass untrusted or unreviewed input to the --filter option of \u0027ros2 topic hz\u0027."
        }
      ],
      "x_generator": {
        "engine": "cvelib 1.8.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "cc1ad9ee-3454-478d-9317-d3e869d708bc",
    "assignerShortName": "canonical",
    "cveId": "CVE-2024-42002",
    "datePublished": "2026-09-28T21:38:08.369Z",
    "dateReserved": "2024-08-01T12:00:12.183Z",
    "dateUpdated": "2026-09-30T13:43:15.912Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2"
}