Medium

Nuxt dev server exposes private runtime config through the Nitro dev bundle

  • Disclosed: 30.10.2026
  • Updated: 31.10.2026 01:17

Summary

With Nitro 2 (the default server engine in Nuxt 3 and Nuxt 4), the Nitro development server bundle written by nuxt dev can be fetched through the Vite dev server. Nitro inlines the resolved runtimeConfig into that bundle, so private runtime config values that were resolved at build time can be read by anyone with HTTP access to the dev server.

Impact

nuxt dev writes the Nitro development server bundle to <buildDir>/dev/index.mjs (by default .nuxt/dev/index.mjs). The build directory is inside the directories Nuxt passes to Vite's server.fs.allow, so the bundle is served by the dev server:

bash
curl http://<dev-server>/_nuxt/@fs/<absolute-path-to-project>/.nuxt/dev/index.mjs

The response contains every private (non-public) runtime config value that was resolved at build time. That includes values set in nuxt.config, such as a secret read from .env:

ts
export default defineNuxtConfig({
  runtimeConfig: {
    apiSecret: process.env.API_SECRET,
  },
})

From Nuxt 4.6.0, it also includes the generated development appSecret. Vite's default deny list blocks .env itself, but not the bundle containing values read from it.

Exploitation requires direct HTTP access to the dev server. nuxt dev listens on localhost by default, so this mainly affects dev servers that are exposed to a network (for example with --host, a published container port or a tunnel). As far as we can tell, a malicious website cannot read the file through a developer's browser: Vite's CORS and host checks prevent pages on other origins from reading the response.

Production builds are not affected, because the Vite dev server is not used and the server bundle is not served. Nuxt projects using Nitro 3 do not write the server bundle to disk in development and are not affected. Private runtime config values that are left empty in nuxt.config and supplied through NUXT_* environment variables are applied when the server starts, are not inlined into the bundle, and are not exposed.

Patches

Fixed in @nuxt/vite-builder 4.6.3, which nuxt 4.6.3 depends on. The dev server now adds Nitro's development output directory to Vite's server.fs.deny, keeping Vite's default deny list.

Nuxt 3 has reached end of life and will not receive a fix.

Workarounds

Avoid exposing the dev server to untrusted networks. Alternatively, set private runtime config keys to an empty default in nuxt.config and provide their values with the matching NUXT_* environment variables (for example runtimeConfig: { apiSecret: '' } with NUXT_API_SECRET in .env).

If a dev server has been reachable by untrusted clients, rotate any credentials that were set through runtimeConfig in nuxt.config.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package @nuxt/vite-builder >= 3.0.0, < 4.6.3 4.6.3

References

CVSS score 5.9/10
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Weakness (CWE)
CWE-200, CWE-538, CWE-552
Platform
npm
Package
@nuxt/vite-builder
Disclosed
30.10.2026
Updated
31.10.2026 01:17

Sources and licenses

OSV / GitHub Advisory Database - GHSA-648h-gw55-m2g7 - CC BY 4.0

Vulnerability history: @nuxt/vite-builder

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
4
First → latest
01.2025 10.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Medium 4

Disclosures per year

  1. 2025: 1
  2. 2026: 3
  1. Medium · 4.8 CVE-2026-119201 >= 4.6.0, < 4.6.3 4.6.3
  2. Medium · 5.9 CVE-2026-119198 >= 4.6.0, < 4.6.3 4.6.3
  3. Nuxt dev server exposes private runtime config through the Nitro dev bundle this entry
    Medium · 5.9 CVE-2026-119199 >= 3.0.0, < 4.6.3 4.6.3

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.