Nuxt 3 RC arbitrary file read via Vite dev server (CVE-2023-54418)

Nuxt 3.0.0-rc.1 through 3.0.0-rc.12 are vulnerable to an unauthenticated arbitrary file read when the Vite dev server is exposed. The default vite.server.fs.strict=false setting allows requests to /_nuxt/@fs/<absolute path> with a raw query to read files such as /etc/passwd. Exploitation was observed by the Shadowserver Foundation on 2023-10-18.

Overview

CVE-2023-54418 affects Nuxt 3.0.0-rc.1 before 3.0.0-rc.13. The vulnerability is caused by the Vite dev server default setting vite.server.fs.strict=false. An unauthenticated attacker can send a crafted request to /_nuxt/@fs/<absolute path> with a raw query and read arbitrary files from the host filesystem, including sensitive files like /etc/passwd.

This issue is relevant to JavaScript stacks running Nuxt 3 release candidates. It is especially dangerous if the Vite dev server is exposed to untrusted networks or if the application is deployed in a way that leaves the dev server accessible.

What to do

1. Identify the Nuxt version in use. If you are on 3.0.0-rc.1 through 3.0.0-rc.12, you are affected. 2. Upgrade to Nuxt 3.0.0-rc.13 or any later release, including current stable 3.x releases. Verify the exact fixed version in the official Nuxt advisory before changing production. 3. If an immediate upgrade is not possible, do not expose the Vite dev server to untrusted networks. Restrict access to the dev server and review whether vite.server.fs.strict can be set to true in your environment. 4. Check access logs for suspicious requests to /_nuxt/@fs/ or paths containing @fs with raw query strings, especially from unauthenticated sources. 5. Monitor Shadowserver and vendor guidance for any additional exploitation indicators or required actions.

Sources