# CVE-2024-42468: Path traversal (CometVisu)

> Unauthenticated attackers can read local server files via path traversal in the CometVisuServlet of openHAB.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 Aug 2024
- **Updated:** 13 Aug 2024
- **Also known as:** GHSA-pcwp-26pw-j98w

## What is CVE-2024-42468?

CVE-2024-42468 is a medium-severity path traversal vulnerability in openhab-webui, published on 9 Aug 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

openHAB, a provider of open-source home automation software, has add-ons including the visualization add-on CometVisu. CometVisuServlet in versions prior to 4.2.1 is susceptible to an unauthenticated path traversal vulnerability. Local files on the server can be requested via HTTP GET on the CometVisuServlet. This issue may lead to information disclosure. Users should upgrade to version 4.2.1 of the CometVisu add-on of openHAB to receive a patch.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2024-42468?

2 open source packages ship an affected version, including org.openhab.ui.bundles:org.openhab.ui.cometvisu. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.openhab.ui.bundles:org.openhab.ui.cometvisu` | Maven | All versions | 4.2.1 |
| `org.openhab.ui.bundles:org.openhab.ui.cometvisu` | Maven | All versions | 4.2.1 |

Products: Openhab Openhab.

## How do I fix CVE-2024-42468?

Upgrade org.openhab.ui.bundles:org.openhab.ui.cometvisu to 4.2.1 or later.

## Is CVE-2024-42468 being exploited?

There is no known exploitation of CVE-2024-42468 in the wild and no public exploit code.

## Other vulnerabilities in openhab-webui

- [CVE-2024-42469](https://insights.sbomify.com/CVE-2024-42469/): CometVisu Backend for openHAB affected by RCE through path traversal (critical 9.8)
- [CVE-2020-5242](https://insights.sbomify.com/CVE-2020-5242/): openHAB exec add-ons allow remote arbitrary command execution (high 7.7)
- [CVE-2024-42470](https://insights.sbomify.com/CVE-2024-42470/): CometVisu Backend for openHAB has a sensitive information disclosure vulnerability (medium 6.5)
- [CVE-2021-21266](https://insights.sbomify.com/CVE-2021-21266/): XXE vulnerability in OpenHAB (medium 6.4)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-42468 and fix it if it is affected.

What it is: CVE-2024-42468 is a medium-severity path traversal vulnerability in openhab-webui, published on 9 Aug 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-42468 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.openhab.ui.bundles:org.openhab.ui.cometvisu (Maven): affected all versions; fixed in 4.2.1
- org.openhab.ui.bundles:org.openhab.ui.cometvisu (Maven): affected all versions; fixed in 4.2.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-42468/ (Markdown: https://insights.sbomify.com/CVE-2024-42468/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-42468
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-42468
- OSV: https://osv.dev/vulnerability/CVE-2024-42468

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-42468/
Summaries are generated and may contain mistakes; the official description above is the record.
