---
id: "GHSA-m9j8-jcmv-hp69"
page: "https://infrastack.ai/live/GHSA-m9j8-jcmv-hp69"
kind: "vulnerability"
aliases: ["GHSA-m9j8-jcmv-hp69"]
title: "Build-time server-only module import guard could fail, resulting in server secrets being statically replaced in client bundle"
severity: "high"
cvss: 7.5
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "@sveltejs/kit", "fixed": ["3.1.1"], "affected": ">= 3.0.0, <= 3.1.0", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["cwe-200", "cwe-668", "npm", "package", "svelte", "sveltekit"]
not_affected_if: ["no-params-js-server-imports", "version-outside-range"]
published_at: "2026-10-29T23:47:22+00:00"
first_seen_at: "2026-11-09T22:53:15+00:00"
updated_at: "2026-11-09T22:54:27+00:00"
sources: [{"source": "ghsa-repo", "url": "https://github.com/sveltejs/kit/security/advisories/GHSA-m9j8-jcmv-hp69", "first_seen_at": "2026-11-09T22:53:15+00:00"}]
exploit_sources: []
---

# Build-time server-only module import guard could fail, resulting in server secrets being statically replaced in client bundle

Link for people: https://infrastack.ai/live/GHSA-m9j8-jcmv-hp69 (this .md is for agents)

Under certain conditions, modules meant only for the server can end up in the browser build of a SvelteKit app. Server secrets referenced through those imports can then be read by anyone who loads the client bundle.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:@sveltejs/kit affected >= 3.0.0, <= 3.1.0 fixed 3.1.1

## How to check

- Run `npm ls @sveltejs/kit` and confirm whether the installed version is between `3.0.0` and `3.1.0`.
- Check whether `src/params.js` imports any server-only module that contains secrets.

## Fix

- Upgrade `@sveltejs/kit` to `3.1.1`.

## Timeline

- 2026-11-09T22:53:15+00:00 ghsa-repo https://github.com/sveltejs/kit/security/advisories/GHSA-m9j8-jcmv-hp69

## Documents

- [advisory] Maintainer's advisory: github.com https://github.com/sveltejs/kit/security/advisories/GHSA-m9j8-jcmv-hp69

## From the sources

Under certain circumstances, server-only imports, which typically cannot be included in the client bundle, could make their way into it, potentially exposing secrets. This could only occur when those server-only imports were made through `src/params.js`.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
