CVE-2024-42469: Org.openhab.ui.cometvisu Remote Code Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-f729-58x4-gqgf
CVSS 9.8
CWE-22
Published
Advisory Summary

CVE-2024-42469 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Org.openhab.ui.cometvisu libraries in the Maven ecosystem. The issue involves cometvisu backend for openhab affected by rce through path traversal. Remediation is available by upgrading affected packages to version 4.2.1.

CVE-2024-42469 at a Glance

CVE Identifier CVE-2024-42469
GHSA Identifier GHSA-f729-58x4-gqgf
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Org.openhab.ui.cometvisu
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-42469

To remediate this vulnerability, upgrade all affected Org.openhab.ui.cometvisu dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.openhab.ui.bundles:org.openhab.ui.cometvisu fixed: 4.2.1
<dependency>
    <groupId>org.openhab.ui.bundles</groupId>
    <artifactId>org.openhab.ui.cometvisu</artifactId>
    <version>4.2.1</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.openhab.ui.bundles

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2024-42469, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.openhab.ui.bundles

Analyze the terminal output to locate any version of Org.openhab.ui.cometvisu in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.2.1), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.openhab.ui.bundles command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Org.openhab.ui.cometvisu, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

CometVisu's file system endpoints don't require authentication and additionally the endpoint to update an existing file is susceptible to path traversal. This makes it possible for an attacker to overwrite existing files on the openHAB instance. If the overwritten file is a shell script that is executed at a later time this vulnerability can allow remote code execution by an attacker. This vulnerability was discovered with the help of CodeQL's [Uncontrolled data used in path expression](https://codeql.github.com/codeql-query-help/java/java-path-injection/) query. ## Impact This issue may lead up to Remote Code Execution (RCE).

CVE-2024-42469 Affected Org.openhab.ui.cometvisu Versions

1 component(s)
Fixed Versions:
4.2.1
Product / Package Ecosystem Affected Versions Fixed Version
org.openhab.ui.bundles:org.openhab.ui.cometvisu
Maven
< 4.2.1
4.2.1

References

Frequently Asked Questions

What is CVE-2024-42469?
CVE-2024-42469 is a security vulnerability in Org.openhab.ui.cometvisu involving CometVisu Backend for openHAB affected by RCE through path traversal under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Org.openhab.ui.cometvisu versions are affected?
Affected versions include releases prior to 4.2.1 across affected packages: org.openhab.ui.bundles:org.openhab.ui.cometvisu.
What version fixes CVE-2024-42469?
Upgrading to 4.2.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is org.openhab.ui.cometvisu affected?
Yes, org.openhab.ui.bundles:org.openhab.ui.cometvisu is affected in releases prior to 4.2.1. Upgrade your dependency to 4.2.1 or later.
What is the CVSS score of CVE-2024-42469?
CVE-2024-42469 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2024-42469?
CVE-2024-42469 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Maven dependencies for CVE-2024-42469?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.openhab.ui.bundles'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f729-58x4-gqgf",
  "modified" : "2024-08-12T16:01:17Z",
  "published" : "2024-08-09T18:24:07Z",
  "aliases" : [ "CVE-2024-42469" ],
  "summary" : "CometVisu Backend for openHAB affected by RCE through path traversal",
  "details" : "CometVisu's file system endpoints don't require authentication and additionally the endpoint to update an existing file is susceptible to path traversal. This makes it possible for an attacker to overwrite existing files on the openHAB instance. If the overwritten file is a shell script that is executed at a later time this vulnerability can allow remote code execution by an attacker.\n\nThis vulnerability was discovered with the help of CodeQL's [Uncontrolled data used in path expression](https://codeql.github.com/codeql-query-help/java/java-path-injection/) query.\n\n## Impact\n\nThis issue may lead up to Remote Code Execution (RCE).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.openhab.ui.bundles:org.openhab.ui.cometvisu"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.2.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.2.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/openhab/openhab-webui/security/advisories/GHSA-f729-58x4-gqgf"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-42469"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/openhab/openhab-webui/commit/630e8525835c698cf58856aa43782d92b18087f2"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/openhab/openhab-webui"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-08-09T18:24:07Z",
    "nvd_published_at" : "2024-08-12T13:38:35Z"
  }
}