All the vulnerabilities related to the version 1.3.1 of the package
Nuxt Devtools has a Path Traversal: '../filedir'
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 (source), 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) leading to CSWSH. 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).
In the scenario that:
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.
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: https://devtools-exploit.pages.dev
pnpm run dev
.The POC will: