CVE-2024-23657 Path Traversal: '../filedir' in Nuxt Devtools

High 8.8 Published Updated

Attackers can read arbitrary files and achieve remote code execution via path traversal and missing origin checks in Nuxt Devtools.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-23657?

CVE-2024-23657 is a high-severity path traversal vulnerability in nuxt, published on 5 Aug 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

Nuxt is a free and open-source framework to create full-stack web applications and websites with Vue.js. Nuxt Devtools is missing authentication on the `getTextAssetContent` RPC function which is vulnerable to path traversal. Combined with a lack of Origin checks on the WebSocket handler, an attacker is able to interact with a locally running devtools instance and exfiltrate data abusing this vulnerability. In certain configurations an attacker could leak the devtools authentication token and then abuse other RPC functions to achieve RCE. The `getTextAssetContent` function does not check for path traversals, this could allow an attacker to read arbitrary files over the RPC WebSocket. The WebSocket server does not check the origin of the request leading to cross-site-websocket-hijacking. This may be intentional to allow certain configurations to work correctly. Nuxt Devtools authentication tokens are placed within the home directory of the current user. The malicious webpage can connect to the Devtools WebSocket, perform a directory traversal brute force to find the authentication token, then use the *authenticated* `writeStaticAssets` function to create a new Component, Nitro Handler or `app.vue` file which will run automatically as the file is changed. This vulnerability has been addressed in release version 1.3.9. All users are advised to upgrade. There are no known workarounds for this vulnerability.

Weakness: CWE-24, CWE-22

Which versions are affected by CVE-2024-23657?

2 open source packages ship an affected version, including @nuxt/devtools. It affects 1 product.

PackageAffectedFixed in
@nuxt/devtools npmAll versions1.3.9
@nuxt/devtools npmAll versions1.3.9

Products include Nuxt Nuxt.

How do I fix CVE-2024-23657?

Upgrade @nuxt/devtools to 1.3.9 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2024-23657 being exploited?

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

Sources

Also known as GHSA-rcvg-rgf7-pppv.

Is CVE-2024-23657 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free