---
title: "GHSA-rcvg-rgf7-pppv: Nuxt Devtools has a Path Traversal: '../filedir'"
description: "High severity. Nuxt Devtools has a Path Traversal: '../filedir'. Affects @nuxt/devtools; fixed in 1.3.9."
url: https://inlinr.com/advisories/GHSA-rcvg-rgf7-pppv
lang: en
---

[Packages](https://inlinr.com/packages) / [@nuxt/devtools](https://inlinr.com/packages/@nuxt/devtools) / [Security](https://inlinr.com/packages/@nuxt/devtools/security)

High Vulnerability GHSA-rcvg-rgf7-pppv CVE-2024-23657 Published 5 Aug 2024

# Nuxt Devtools has a Path Traversal: '../filedir'

Your version 

Affected releases · [@nuxt/devtools](https://inlinr.com/packages/@nuxt/devtools)

- 1.x 1.0.0 – 1.3.8 Fixed in 1.3.9
- 0.8.x and older 0.0.0 – 0.8.5 No fix, no longer updated

On 1.x, the newest line:

```
npm install @nuxt/devtools@1.3.9
```

Every release on a timeline

4.x 

1. Not affected

4.0.0 – 4.2.0  
3 releases, latest

1.x 

1. Affected

1.0.0 – 1.3.8  
25 releases
2. Fixed

1.3.9 – 1.7.0  
14 releases

0.x 

1. Affected

0.0.0 – 0.8.5  
51 releases

127 stable releases of @nuxt/devtools, oldest to newest, one row per major.

## What happens

Summary

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. 

Details

The `getTextAssetContent` function does not check for path traversals [(source)](https://github.com/nuxt/devtools/blob/c4f2b68281203fc3f61ffc97d9c6623fbfde46bb/packages/devtools/src/server-rpc/assets.ts#L88C48-L88C48 "https://github.com/nuxt/devtools/blob/c4f2b68281203fc3f61ffc97d9c6623fbfde46bb/packages/devtools/src/server-rpc/assets.ts#L88C48-L88C48"), this could allow an attacker to read arbitrary files over the RPC WebSocket. 

The WebSocket server does not check the origin of the request [(source)](https://github.com/nuxt/devtools/blob/c4f2b68281203fc3f61ffc97d9c6623fbfde46bb/packages/devtools/src/server-rpc/index.ts#L109 "https://github.com/nuxt/devtools/blob/c4f2b68281203fc3f61ffc97d9c6623fbfde46bb/packages/devtools/src/server-rpc/index.ts#L109") leading to [CSWSH](https://portswigger.net/web-security/websockets/cross-site-websocket-hijacking "https://portswigger.net/web-security/websockets/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 [(source)](https://github.com/nuxt/devtools/blob/c4f2b68281203fc3f61ffc97d9c6623fbfde46bb/packages/devtools/src/dev-auth.ts#L14 "https://github.com/nuxt/devtools/blob/c4f2b68281203fc3f61ffc97d9c6623fbfde46bb/packages/devtools/src/dev-auth.ts#L14").

In the scenario that:

- The user has a Nuxt3 Project running
- Devtools is enabled and running
- The project is placed within the users home directory.
- The user visits a malicious webpage
- User has authenticated with devtools at least once

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](https://github.com/nuxt/devtools/blob/c4f2b68281203fc3f61ffc97d9c6623fbfde46bb/packages/devtools/src/server-rpc/assets.ts#L96C11-L96C28 "https://github.com/nuxt/devtools/blob/c4f2b68281203fc3f61ffc97d9c6623fbfde46bb/packages/devtools/src/server-rpc/assets.ts#L96C11-L96C28") to create a new Component, Nitro Handler or `app.vue` file which will run automatically as the file is changed.

PoC

POC will exploit the Devtools server on localhost:3000 (you may need to manually restart the server as the restart hook does not always work).

POC: [devtools-exploit.pages.dev](https://devtools-exploit.pages.dev/ "https://devtools-exploit.pages.dev/")

1. Create a new project with nuxt.new.
2. Place the project inside your home directory.
3. Run `pnpm run dev`.
4. Open the POC page.

The POC will:

- Identify devtools version.
- Leak your devtools token.
- Create a new server handler with an insecure eval.

Impact

- All new Nuxt projects by default (devtools is enabled) are vulnerable to arbitrary file read.
- Certain Nuxt configurations are vulnerable to Remote Code Execution

## How it is exploited

Exploitable over the network, with no account and a user to do something.

- **Confidentiality**: high
- **Integrity**: high
- **Availability**: high

CVSS:3.1/​AV:N/​AC:L/​PR:N/​UI:R/​S:U/​C:H/​I:H/​A:H

## References

- [Reference](https://github.com/nuxt/nuxt/security/advisories/GHSA-rcvg-rgf7-pppv "https://github.com/nuxt/nuxt/security/advisories/GHSA-rcvg-rgf7-pppv")  
github.com/nuxt/nuxt/security/advisories/GHSA-r…
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2024-23657 "https://nvd.nist.gov/vuln/detail/CVE-2024-23657")  
nvd.nist.gov/vuln/detail/CVE-2024-23657
- [Reference](https://github.com/nuxt/devtools/blob/c4f2b68281203fc3f61ffc97d9c6623fbfde46bb/packages/devtools/src/dev-auth.ts#L14 "https://github.com/nuxt/devtools/blob/c4f2b68281203fc3f61ffc97d9c6623fbfde46bb/packages/devtools/src/dev-auth.ts#L14")  
github.com/nuxt/devtools/blob/c4f2b68281203fc3f…
- [Reference](https://github.com/nuxt/devtools/blob/c4f2b68281203fc3f61ffc97d9c6623fbfde46bb/packages/devtools/src/server-rpc/assets.ts#L88C48-L88C48 "https://github.com/nuxt/devtools/blob/c4f2b68281203fc3f61ffc97d9c6623fbfde46bb/packages/devtools/src/server-rpc/assets.ts#L88C48-L88C48")  
github.com/nuxt/devtools/blob/c4f2b68281203fc3f…
- [Reference](https://github.com/nuxt/devtools/blob/c4f2b68281203fc3f61ffc97d9c6623fbfde46bb/packages/devtools/src/server-rpc/assets.ts#L96C11-L96C28 "https://github.com/nuxt/devtools/blob/c4f2b68281203fc3f61ffc97d9c6623fbfde46bb/packages/devtools/src/server-rpc/assets.ts#L96C11-L96C28")  
github.com/nuxt/devtools/blob/c4f2b68281203fc3f…
- [Reference](https://github.com/nuxt/devtools/blob/c4f2b68281203fc3f61ffc97d9c6623fbfde46bb/packages/devtools/src/server-rpc/index.ts#L109 "https://github.com/nuxt/devtools/blob/c4f2b68281203fc3f61ffc97d9c6623fbfde46bb/packages/devtools/src/server-rpc/index.ts#L109")  
github.com/nuxt/devtools/blob/c4f2b68281203fc3f…
- [Package](https://github.com/nuxt/nuxt "https://github.com/nuxt/nuxt")  
github.com/nuxt/nuxt
- [Reference](https://portswigger.net/web-security/websockets/cross-site-websocket-hijacking "https://portswigger.net/web-security/websockets/cross-site-websocket-hijacking")  
portswigger.net/web-security/websockets/cross-s…

A whole project to check? Paste its package.json in the [dependency check](https://inlinr.com/tools/dependency-check): every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.
