Nov 16, 2026·10 min read·1 visit
A fail-open logic flaw and missing client entrypoint registration in SvelteKit's build-time module guard allow server-only modules and private environment variables ($app/env/private) imported via src/params.js to be bundled into public client-side JavaScript assets in @sveltejs/kit versions 3.0.0 through 3.1.0.
CVE-2026-128118 (GHSA-m9j8-jcmv-hp69) is an information disclosure vulnerability affecting the SvelteKit framework (@sveltejs/kit) from version 3.0.0 through 3.1.0. A design flaw in the build-time Vite module guard plugin (plugin_guard) failed to register src/params.js as a client entry point and implemented a fail-open validation model. Consequently, server-only modules and private environment variables imported directly or dynamically within parameter matchers were compiled into publicly accessible client-side JavaScript bundles without triggering a build error.
SvelteKit (@sveltejs/kit) is an application framework for building web applications using Svelte. Because SvelteKit applications execute code across both server-side environments (Node.js or edge runtimes) and client-side web browsers, the framework enforces strict boundaries to prevent sensitive server-side logic and credentials from leaking into browser-accessible bundles. This separation is enforced at compile time by a custom Vite plugin named plugin_guard located in packages/kit/src/exports/vite/plugins/guard.js.
In SvelteKit 3.0.0 through 3.1.0, plugin_guard contains a logic flaw classified under CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor) and CWE-668 (Exposure of Resource to Wrong Sphere). Specifically, the guard plugin omits src/params.js—the module responsible for defining route parameter matchers via defineParams—from its internal registry of known client-side entry points. Because parameter matchers execute in the browser when client-side routing resolution (router.resolution: 'client') is active, Vite includes src/params.js and its dependencies in the client build graph.
When a developer imports a restricted server-only module (such as $app/env/private, $app/server, *.server.js, or files within src/lib/server/) inside src/params.js, plugin_guard attempts to trace the dependency chain back to a registered client entrypoint. Because src/params.js is absent from the entrypoint set, the trace returns null. Rather than halting the build upon encountering an unlinked server module during client bundling, the pre-patch guard plugin failed open, operating under the false assumption that a null trace meant the module was only imported by server code.
As a result of this fail-open behavior, Vite compiles the server-only module and statically inlines any referenced private environment variables directly into the client-side JavaScript chunks output to .svelte-kit/output/client/_app/immutable/chunks/*.js. Any unauthenticated remote user can retrieve these static JavaScript assets over HTTP and extract embedded API keys, database connection strings, or private cryptographic secrets.
To enforce boundary separation between server and client execution contexts, SvelteKit designates specific module specifiers and file path patterns as server-only. These include the built-in $app/server and $app/env/private modules, any file matching the *.server.* naming convention, and any module residing inside a /server/ directory (such as src/lib/server/** or #lib/server/**). During the Vite build lifecycle, plugin_guard intercepts module loads while bundling client assets and maintains an import_map that records parent-child import relationships across the module graph.
The root cause of CVE-2026-128118 consists of three distinct flaws in packages/kit/src/exports/vite/plugins/guard.js. First, during plugin initialization, plugin_guard populates an entrypoints Set containing the root files of the client bundle, including route components, manifest_data.hooks.client, manifest_data.hooks.universal, and service_worker_entry_file. However, when src/params.js was introduced in SvelteKit 3.0, manifest_data.params was omitted from this registration step. Consequently, the dependency graph rooted at src/params.js was disconnected from all tracked entrypoints in entrypoints.
Second, the dependency traversal function find_chain was paired with a permissive fallback. When plugin_guard intercepted a server-only module during the client build phase, it executed find_chain(normalized, [normalized]) to walk upward through import_map until it reached a node present in entrypoints. If find_chain returned a valid array of module IDs, the plugin threw a server_only_import error and aborted compilation. If find_chain returned null, the plugin executed no action and allowed compilation to proceed, assuming that an inability to reach a known client entrypoint meant the module was exclusively used by the server.
Third, the regular expression and path validation logic used to identify server-only modules contained a parsing discrepancy when handling Vite query parameters (such as ?raw or ?url). The regex server_only_module_pattern failed to match module IDs when query parameters contained forward slashes (e.g., #lib/test.server.js?raw&x=a/b), and is_server_only_path evaluated the raw module ID without stripping the query suffix. This allowed specially formatted query imports of .server.js files to evade path boundary checks entirely.
The vulnerability resides in packages/kit/src/exports/vite/plugins/guard.js and was remediated in commit ae07803806f75b8b5662ae4ab92934ca1356fd84. Examining the pre-patch implementation demonstrates how plugin_guard initialized entrypoints and handled find_chain results.
// Pre-patch logic in packages/kit/src/exports/vite/plugins/guard.js
if (manifest_data.hooks.client) add_entrypoint(manifest_data.hooks.client);
if (manifest_data.hooks.universal) add_entrypoint(manifest_data.hooks.universal);
if (service_worker_entry_file) {
add_entrypoint(service_worker_entry_file);
}
// FLAW 1: manifest_data.params is never passed to add_entrypoint()
// Inside the module load verification hook:
const chain = find_chain(normalized, [normalized]);
if (chain) {
const pyramid = chain
.reverse()
.map((id, i) => `${' '.repeat(i + 1)}${id}`)
.join(' imports\n');
e.server_only_import({ module: normalized, chain: pyramid }, { stackless: true });
}
// FLAW 2: If chain is null, execution continues without throwing an error.
// Pre-patch comment:
// No chain from this server-only module to a client entrypoint was found —
// the module is only imported from server code, which is valid.In the patched version (@sveltejs/kit@3.1.1), the maintainers addressed both the missing entrypoint and the fail-open architecture. First, manifest_data.params is explicitly registered as a client entrypoint. Second, find_chain was refactored to accept a predicate function is_root, and the guard logic was inverted to fail closed whenever a server-only module is encountered during client bundling.
// Patched logic in packages/kit/src/exports/vite/plugins/guard.js
if (manifest_data.hooks.client) add_entrypoint(manifest_data.hooks.client);
if (manifest_data.hooks.universal) add_entrypoint(manifest_data.hooks.universal);
// FIX 1: Register src/params.js as a known client entrypoint
if (manifest_data.params) add_entrypoint(manifest_data.params);
if (service_worker_entry_file) {
add_entrypoint(service_worker_entry_file);
}
// FIX 2: Parameterize find_chain with an is_root predicate
function find_chain(id, chain, is_root) {
if (is_root(id)) return chain;
// ... recursive traversal through import_map ...
}
let chain = find_chain(normalized, [normalized], (id) => entrypoints.has(id));
if (!chain) {
// FIX 3: Fail-closed fallback. If no known entrypoint is reached, walk back
// to the topmost parent in import_map and throw server_only_import regardless.
visited = new Set([normalized]);
chain = find_chain(normalized, [normalized], (id) => !import_map.has(id)) ?? [normalized];
}
const pyramid = chain
.reverse()
.map((id, i) => `${' '.repeat(i + 1)}${id}`)
.join(' imports\n');
e.server_only_import({ module: normalized, chain: pyramid }, { stackless: true });Additionally, the patch hardened module path detection against query parameter bypasses by introducing server_only_module_with_query_pattern and stripping query parameters prior to invoking is_server_only_path:
const server_only_module_pattern = /[/.]server\.[^/?]+$/;
const server_only_module_with_query_pattern = /[/.]server\.[^/?]+\?/;
const query_pattern = /\?.*$/s;
// Strips query string before checking directory boundaries
is_server_only_path(id.replace(query_pattern, ''), {
cwd,
lib: config.kit.files.lib
});This remediation is complete. By transitioning plugin_guard from a blocklist-on-match model to an unconditional fail-closed model during client bundle generation, any future client entrypoint types added to SvelteKit will still trigger a build failure if they pull in a server-only dependency, even if the new entrypoint is inadvertently omitted from the entrypoints set.
Exploiting CVE-2026-128118 from an external perspective does not require authentication, special privileges, or complex network positioning (AV:N/AC:L/PR:N/UI:N). The vulnerability is triggered during the application build phase when a developer writes a parameter matcher in src/params.js that attempts to validate a route parameter against a server-side secret or helper function, expecting either that src/params.js executes on the server or that SvelteKit's compiler guard will reject unsafe imports.
Consider a SvelteKit application using @sveltejs/kit@3.1.0 where a developer restricts access to a route /[token=gate] by comparing the URL parameter against a private environment variable or server secret. The application defines a secret in src/lib/server/secret.js or .env and imports it into src/params.js:
// src/lib/server/allow.js
import { SHOULD_EXPLODE } from '$app/env/private';
export function is_allowed(value) {
return value === SHOULD_EXPLODE;
}// src/params.js
import { defineParams } from '@sveltejs/kit/params';
export const params = defineParams({
gate: async (param) => {
const { is_allowed } = await import('./lib/server/allow.js');
return is_allowed(param) ? param : undefined;
}
});When the application is compiled using vite build, Vite processes src/params.js for the client bundle. Whether the import is static (import { secret } from '#lib/server/secret.js') or dynamic (await import('./lib/server/allow.js')), plugin_guard fails to link src/params.js to a registered client entrypoint and allows the build to succeed. Vite then resolves $app/env/private and statically replaces SHOULD_EXPLODE with its literal string value inside .svelte-kit/output/client/_app/immutable/chunks/.
> [!NOTE]
> Once the application is deployed, an attacker only needs to inspect the HTML source or client-side routing manifest of any public page, locate the JavaScript chunk URLs under /_app/immutable/, and download the files via standard HTTP GET requests to read the embedded plaintext credentials.
In @sveltejs/kit@3.1.1, running vite build on the exact same codebase immediately aborts compilation with the following diagnostic output:
Cannot import #lib/server/secret.js into client-side code:
src/params.js imports
#lib/server/secret.jsCVE-2026-128118 carries a CVSS v3.1 base score of 7.5 (High) with the vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N. The impact is concentrated entirely on Confidentiality (C:H), with no direct impact on application Integrity (I:N) or Availability (A:N) within the SvelteKit runtime itself. However, the secondary impact of leaking private server modules depends on the nature of the secrets imported into src/params.js or transitive dependencies.
In a typical server-only module (src/lib/server/**), developers store database initialization clients, administrative API tokens, JWT signing secrets, and third-party service credentials retrieved via $app/env/private or $env/static/private. Even if src/params.js only imports a benign utility function from a .server.js module, Vite may bundle top-level constants and private environment variables declared within that same file or its imported module graph into the client output.
The exposure window is limited to applications using @sveltejs/kit versions 3.0.0 through 3.1.0 that specifically utilize src/params.js (defineParams) and import server-only files within that module. As of November 2026, the Exploit Prediction Scoring System (EPSS) assigns CVE-2026-128118 a score of 0.00282 (21.02nd percentile), and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog.
Development teams running @sveltejs/kit versions 3.0.0 through 3.1.0 should upgrade to version 3.1.1 or later. Upgrading restores compile-time enforcement of server-only module boundaries across src/params.js and ensures plugin_guard fails closed on any unrecognized client import chain.
# Upgrade using npm
npm install @sveltejs/kit@^3.1.1
# Upgrade using pnpm
pnpm update @sveltejs/kit@^3.1.1
# Upgrade using yarn
yarn upgrade @sveltejs/kit@^3.1.1After upgrading @sveltejs/kit, run a full production build (vite build). If the build now fails with a Cannot import ... into client-side code error pointing to src/params.js, this indicates that the application was previously affected and was bundling server-only modules into the client assets.
> [!IMPORTANT]
> If an application built with @sveltejs/kit 3.0.0–3.1.0 was deployed to production with server-only imports in src/params.js, upgrading the package and rebuilding is not sufficient on its own. Any secrets, API keys, or credentials referenced by those modules must be treated as compromised, revoked, and rotated immediately, as historical client bundles may have been cached by CDNs, web archives, or end-user browsers.
For environments where an immediate dependency upgrade is blocked, security teams should audit src/params.js to ensure it only contains self-contained, non-sensitive validation logic (such as regular expression matching for integers, UUIDs, or slugs) and scan compiled client artifacts in .svelte-kit/output/client/ for accidental secret inclusion. Any route validation that requires checking a parameter against a secret token or database record must be moved out of src/params.js and into server-side load functions (+page.server.js, +layout.server.js) or server hooks (src/hooks.server.js).
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
@sveltejs/kit sveltejs | >= 3.0.0, < 3.1.1 | 3.1.1 |
| Attribute | Detail |
|---|---|
| Vulnerability ID | CVE-2026-128118 / GHSA-m9j8-jcmv-hp69 |
| Affected Package | @sveltejs/kit (3.0.0 - 3.1.0) |
| Patched Version | @sveltejs/kit@3.1.1 |
| Weakness Class | CWE-200 / CWE-668 (Information Exposure / Wrong Sphere) |
| CVSS v3.1 Score | 7.5 High (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N) |
| EPSS Score | 0.282% (21.02nd Percentile) |
| Exploit Status | Proof-of-Concept (Unit test reproduction in patch commit) |
| CISA KEV Status | Not Listed |
An application exposes sensitive information to an actor that is not explicitly authorized to have access to that information, specifically by exposing resources to the wrong control sphere (CWE-668) when bundling server-only secrets into client-side assets.
CVE-2026-128071 is a route-rule authorization bypass and security policy circumvention vulnerability in the Nuxt web framework, affecting `nuxt`, `@nuxt/nitro-server`, and `@nuxt/vite-server` prior to version 4.6.4. Serving as an incomplete fix for GHSA-6gq8-jgmh-3ffp, the flaw arises from an interpretation conflict between Nuxt's route-rule matching logic and Vue Router's catch-all route parameter decoding. When processing an incoming HTTP request containing percent-encoded forward slashes (`%2F` or `%2f`), the route-rule evaluation engine preserves the encoded sequence as a single path segment, failing to match prefix-based rules such as `/admin/**`. However, when the request is subsequently dispatched to a catch-all page route (`app/pages/[...slug].vue`) or a multi-segment parameter handler, the parameters are URL-decoded into literal slash delimiters. This discrepancy allows unauthenticated remote attackers to bypass route-level redirects, authentication middleware (`appMiddleware`), security headers, proxy configurations, and rendering constraints (`ssr: false`, `noScripts`), while the catch-all page resolves and renders the protected resource.
In Natural Language Toolkit (NLTK) versions prior to 3.10.4, the nltk.parse.dependencygraph.dot2img function resolves the Graphviz dot binary through the system PATH using find_binary('dot') and invokes it directly via subprocess.run() instead of routing execution through nltk.pathsec.spawn_trusted(). This omission bypasses file ownership validation, directory writability checks, and dynamic loader environment scrubbing. On multi-user POSIX systems where a victim's PATH contains a directory writable by a local low-privileged attacker, the attacker can plant a malicious dot binary that executes under the victim's privileges when dependency graphs are rendered.
A race condition in Next.js versions 16.3.0 through 16.4.4 allows cross-request cache poisoning and unauthorized information disclosure across root parameters. When an application invokes the same `'use cache'` function both directly during rendering and wrapped inside `unstable_cache()`, a concurrent `unstable_cache()` request arriving during a cold start cache fill joins the in-flight execution. Because the `unstable_cache()` execution context lacks root parameter tracking, the parameter mismatch verification fails, causing `unstable_cache()` to persist root-parameter-scoped data under a global cache key.
CVE-2026-128074 is an algorithmic complexity and Regular Expression Denial of Service (ReDoS) vulnerability in Nuxt versions 4.6.0 through 4.6.3. The flaw resides in the server-side rendering (SSR) runtime components responsible for payload URL generation and experimental early 404 route evaluation. By sending unauthenticated HTTP requests containing long sequences of repeated forward slashes followed by a non-slash character, an attacker can force the V8 regular expression engine into quadratic O(N^2) backtracking, blocking the single-threaded Node.js event loop and degrading application availability.
CVE-2026-128075 (GHSA-96x6-fvhx-49hg) is an information disclosure vulnerability in the Nuxt framework affecting versions 3.0.0 prior to 4.6.4. During Server-Side Rendering (SSR), unhandled non-HTTP exceptions thrown within pages, plugins, or route middleware are automatically wrapped using createError without being flagged as unhandled. Consequently, the production SSR serializer treats these internal exceptions as deliberate public HTTP errors and embeds their raw message and data properties—which frequently contain internal URLs, API credentials, and upstream response payloads—directly into the client-accessible __NUXT_DATA__ hydration state and JSON error responses.
CVE-2026-128076 is an improper encoding and delimiter injection vulnerability in the Nuxt framework affecting Server Components (NuxtIsland). The flaw serves as an incomplete fix for CVE-2026-46342, where the underlying object hashing routine fails to escape structural delimiters in property keys and string values. This enables attackers to craft distinct sets of component properties that resolve to an identical `/__nuxt_island/<Name>_<hash>.json` route path. In deployments relying on static prerendering or path-only CDN caching, this hash collision permits cache poisoning, content substitution, and Cross-Site Scripting (XSS) if island props flow into unescaped HTML sinks.