/

CVE-2023-54417

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in Nuxt vite-node Middleware

CVE-2023-54417

Awaiting Analysis

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Sensitive Information Disclosure

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Nuxt versions before 3.4.2 have a file-read vulnerability in the vite-node development server middleware. An unauthenticated attacker who can reach an exposed middleware endpoint may supply an absolute path to read files accessible to the server process.

Affected context

The issue affects Nuxt 3.0.0 before 3.4.2 when the vite-node development server middleware is available and reachable. The middleware handles requests to /__nuxt_vite_node__/module/; accepting an absolute path as the module identifier can expose files readable by the process.

Exploit preconditions

  • Attack surface: The vite-node development server middleware endpoint
  • Required access: Network access to the endpoint; authentication is not required
  • Trigger point: A GET request to /__nuxt_vite_node__/module/ with an absolute path as the module identifier
  • Why exploitation is possible: The middleware may process an absolute path without adequately restricting file access to an intended directory

Why this happens

The underlying issue is insufficient path validation and containment when handling a module identifier. If an absolute path is accepted without checking that the resolved file remains within an authorized directory, a request can access files outside the intended scope. This behavior is associated with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

Potential impact

  • An attacker may read sensitive files accessible to the server process
  • Exposed files could reveal secrets, configuration, or other confidential information
  • Disclosure of sensitive data could support further attacks against the application or its environment

General mitigation guidance

Common defensive patterns focus on limiting file access and reducing exposure:

  • Resolve requested paths and enforce that they remain within an explicitly allowed directory
  • Prefer a strict allowlist of permitted module identifiers over accepting arbitrary paths
  • Keep development middleware disabled or inaccessible in environments where it is not needed
  • Run the server with least-privilege filesystem permissions so it can access only required files
  • Treat request-derived path values as untrusted and validate them before file operations

How teams detect issues like this

High-level detection approaches include:

  • Review file-serving and module-loading code for use of request-controlled paths without canonicalization and directory-boundary checks
  • Use static analysis to flag filesystem operations that receive unsanitized request values
  • Monitor logs for requests to the vite-node module endpoint containing absolute paths or unusual path patterns
  • Enforce deployment policies that restrict access to development middleware in production environments
  • Use automated code review checks to identify unsafe path construction and file-access patterns

Sources

SourceLink
github.comgithub.com/nuxt/nuxt/commit/886350a27c6b733ae07dfd5f6b8457214aa83fe6
github.comgithub.com/nuxt/nuxt/pull/20345
github.comgithub.com/projectdiscovery/nuclei-templates/blob/main/http/vulnerabilities/nuxt/nuxt-js-semi-lfi.yaml
vulncheck.comvulncheck.com/advisories/nuxt-3.0.0-3.4.1-unauthenticated-file-read-via-vite-node-dev-server
vulncheck.comvulncheck.com/advisories/nuxt-3.0.0-3.4.2-unauthenticated-file-read-via-vite-node-dev-server

Frequently asked

questions

It may be exploitable over the network when the affected vite-node middleware is reachable. The described requests do not require authentication.

The attacker needs network access to the middleware endpoint. The files that may be read are limited by the server process's filesystem permissions.

Restrict file access to an explicit set of permitted paths, and verify after path resolution that each requested file remains within an authorized directory.

Treat request-derived paths as untrusted, avoid exposing development middleware unnecessarily, and apply least-privilege filesystem permissions.

Find out what's already
exploitable in your codebase.