CVE-2024-42002 (GCVE-0-2024-42002)

Vulnerability from cvelistv5 – Published: 2026-09-28 21:38 – Updated: 2026-09-28 21:38
VLAI
Title
Unsafe use of eval() method in ros2 topic hz tool
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.
CWE
  • CWE-95 - Improper neutralization of directives in dynamically evaluated code ('eval injection')
  • CWE-94 - Improper Control of Generation of Code ('Code Injection')
Impacted products
Vendor Product Version CPE status
Open Source Robotics Foundation Robot Operating System 2 (ROS 2) Affected: Rolling Ridley (custom)
Affected: Lyrical Luth (custom)
Affected: Kilted Kaiju (custom)
Affected: Jazzy Jalisco (custom)
Affected: Iron Irwini (custom)
Affected: Humble Hawksbill (custom)
Affected: Galactic Geochelone (custom)
Affected: Foxy Fitzroy (custom)
Affected: Eloquent Elusor (custom)
Affected: Dashing Diademata (custom)
Affected: Crystal Clemmys (custom)
guessed Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "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-28T21:38:08.369Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "nvd": {
      "cve": {
        "affected": [
          {
            "affectedData": [
              {
                "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"
                  }
                ]
              }
            ],
            "source": "security@ubuntu.com"
          }
        ],
        "cveTags": [],
        "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."
          }
        ],
        "id": "CVE-2024-42002",
        "lastModified": "2026-09-28T22:17:28.617",
        "metrics": {
          "cvssMetricV31": [
            {
              "cvssData": {
                "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"
              },
              "exploitabilityScore": 2.5,
              "impactScore": 5.9,
              "source": "security@ubuntu.com",
              "type": "Secondary"
            }
          ],
          "cvssMetricV40": [
            {
              "cvssData": {
                "Automatable": "NOT_DEFINED",
                "Recovery": "NOT_DEFINED",
                "Safety": "NOT_DEFINED",
                "attackComplexity": "LOW",
                "attackRequirements": "NONE",
                "attackVector": "LOCAL",
                "availabilityRequirement": "NOT_DEFINED",
                "baseScore": 8.6,
                "baseSeverity": "HIGH",
                "confidentialityRequirement": "NOT_DEFINED",
                "exploitMaturity": "NOT_DEFINED",
                "integrityRequirement": "NOT_DEFINED",
                "modifiedAttackComplexity": "NOT_DEFINED",
                "modifiedAttackRequirements": "NOT_DEFINED",
                "modifiedAttackVector": "NOT_DEFINED",
                "modifiedPrivilegesRequired": "NOT_DEFINED",
                "modifiedSubAvailabilityImpact": "NOT_DEFINED",
                "modifiedSubConfidentialityImpact": "NOT_DEFINED",
                "modifiedSubIntegrityImpact": "NOT_DEFINED",
                "modifiedUserInteraction": "NOT_DEFINED",
                "modifiedVulnAvailabilityImpact": "NOT_DEFINED",
                "modifiedVulnConfidentialityImpact": "NOT_DEFINED",
                "modifiedVulnIntegrityImpact": "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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
                "version": "4.0",
                "vulnAvailabilityImpact": "HIGH",
                "vulnConfidentialityImpact": "HIGH",
                "vulnIntegrityImpact": "HIGH",
                "vulnerabilityResponseEffort": "NOT_DEFINED"
              },
              "source": "security@ubuntu.com",
              "type": "Secondary"
            }
          ]
        },
        "published": "2026-09-28T22:17:28.617",
        "references": [
          {
            "source": "security@ubuntu.com",
            "url": "https://github.com/ros2/ros2cli/pull/1001"
          },
          {
            "source": "security@ubuntu.com",
            "url": "https://github.com/ros2/ros2cli/pull/133#discussion_r223081766"
          }
        ],
        "sourceIdentifier": "security@ubuntu.com",
        "vulnStatus": "Received",
        "weaknesses": [
          {
            "description": [
              {
                "lang": "en",
                "value": "CWE-94"
              },
              {
                "lang": "en",
                "value": "CWE-95"
              }
            ],
            "source": "security@ubuntu.com",
            "type": "Secondary"
          }
        ]
      }
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…