Skip to content

Update dependency @sveltejs/kit to v2.20.6 [SECURITY] #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 14, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@sveltejs/kit (source) 2.17.3 -> 2.20.6 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2025-32388

Summary

Unsanitized search param names cause XSS vulnerability. You are affected if you iterate over all entries of event.url.searchParams inside a server load function. Attackers can exploit it by crafting a malicious URL and getting a user to click a link with said URL.

Details

SvelteKit tracks which parameters in event.url.searchParams are read inside server load functions. If the application iterates over the these parameters, the uses.search_params array included in the boot script (embedded in the server-rendered HTML) will have any search param name included in unsanitized form.

packages/kit/src/runtime/server/utils.js:150 has the stringify_uses(node) function which prints these out.

Reproduction

In a +page.server.js or +layout.server.js:

/** @​type {import('@​sveltejs/kit').Load} */
export function load(event) {
  const values = {};

  for (const key of event.url.searchParams.keys()) {
    values[key] = event.url.searchParams.get(key);
  }
}

If a user visits the page in question via a link containing ?</script/><script>window.pwned%3D1</script/>, the </script> will be included verbatim in the payload, causing the embedded script to be executed.

It is not necessary to return the parameter value from load or render it in the page, only to read it (which causes it to be tracked as a dependency) while load is running.

Impact

Any application that iterates over all values in event.url.searchParams in a load function in +page.server.js or +layout.server.js (directly or indirectly) is vulnerable to XSS.


Release Notes

sveltejs/kit (@​sveltejs/kit)

v2.20.6

Compare Source

Patch Changes

v2.20.5

Compare Source

Patch Changes
  • allow HandleServerError hook to access getRequestEvent (#​13666)

  • fix: prevent Rollup warnings for undefined hooks (#​13687)

v2.20.4

Compare Source

Patch Changes
  • chore: remove internal class-replacement hack that isn't needed anymore (#​13664)

v2.20.3

Compare Source

Patch Changes
  • fix: only call afterNavigate once on app start when SSR is disabled (#​13593)

v2.20.2

Compare Source

Patch Changes
  • fix: allow non-prerendered API endpoint calls during reroute when prerendering (#​13616)

v2.20.1

Compare Source

Patch Changes
  • fix: avoid using top-level await (#​13607)

v2.20.0

Compare Source

Minor Changes
  • feat: add getRequestEvent to $app/server (#​13582)

v2.19.2

Compare Source

Patch Changes
  • fix: lazily load CSS for dynamically imported components (#​13564)

v2.19.1

Compare Source

Patch Changes
  • fix: allow reroute to point to prerendered route (#​13575)

v2.19.0

Compare Source

Minor Changes
Patch Changes

v2.18.0

Compare Source

Minor Changes
Patch Changes
  • fix: correct navigation history with hash router and ensure load functions are rerun on user changes to URL hash (#​13492)

  • fix: include universal load assets as server assets (#​13531)

  • fix: Include root layout and error nodes even when apps have only prerendered pages (#​13522)

  • fix: correctly preload data on mousedown/touchstart if code was preloaded on hover (#​13530)


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/npm-sveltejs-kit-vulnerability branch from f7db033 to 5f289be Compare April 24, 2025 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants