Skip to content

fix: upgrade @sveltejs/kit to 2.57.1 (CVE-2026-40073)#10637

Open
orbisai0security wants to merge 5 commits into
TanStack:mainfrom
orbisai0security:fix-cve-2026-40073-sveltejs-kit
Open

fix: upgrade @sveltejs/kit to 2.57.1 (CVE-2026-40073)#10637
orbisai0security wants to merge 5 commits into
TanStack:mainfrom
orbisai0security:fix-cve-2026-40073-sveltejs-kit

Conversation

@orbisai0security
Copy link
Copy Markdown

@orbisai0security orbisai0security commented May 5, 2026

Summary

Upgrade @sveltejs/kit from 2.55.0 to 2.57.1 to fix CVE-2026-40073.

Vulnerability

Field Value
ID CVE-2026-40073
Severity HIGH
Scanner trivy
Rule CVE-2026-40073
File pnpm-lock.yaml

Description: @sveltejs/adapter-node has a BODY_SIZE_LIMIT bypass

Changes

  • package.json
  • pnpm-lock.yaml

Verification

  • Build passes
  • Scanner re-scan confirms fix
  • LLM code review passed

Automated security fix by OrbisAI Security

Summary by CodeRabbit

  • Chores
    • Updated Svelte example projects to use a newer version of SvelteKit across all example configurations (auto-refetching, basic, load-more-infinite-scroll, optimistic-updates, playground, SSR, and star-wars examples).

Review Change Stack

Automated dependency upgrade by Orbis Security AI
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

📝 Walkthrough

Walkthrough

This PR updates the SvelteKit framework dependency (@sveltejs/kit) from version ^2.42.2 to ^2.57.1 across seven Svelte example projects: auto-refetching, basic, load-more-infinite-scroll, optimistic-updates, playground, ssr, and star-wars.

Changes

SvelteKit dependency updates

Layer / File(s) Summary
Update @sveltejs/kit to ^2.57.1 across examples
examples/svelte/auto-refetching/package.json, examples/svelte/basic/package.json, examples/svelte/load-more-infinite-scroll/package.json, examples/svelte/optimistic-updates/package.json, examples/svelte/playground/package.json, examples/svelte/ssr/package.json, examples/svelte/star-wars/package.json
All seven example projects update their @sveltejs/kit devDependency from ^2.42.2 to ^2.57.1 to align on a newer framework release.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A rabbit hops through seven gardens fair,
Where Svelte examples flourish in the air,
Each package.json gets a gentle touch,
New SvelteKit versions—we love it much!
^2.57.1 brings the cheer,
To every example, far and near! 🚀

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description deviates from the required template by omitting key sections like the 🎯 Changes, ✅ Checklist, and 🚀 Release Impact sections specified in the template. Restructure the description to follow the provided template, including all required sections: detailed changes explanation, contributor checklist, and release impact assessment.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: upgrading @sveltejs/kit to fix a security vulnerability (CVE-2026-40073).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 107-109: The pnpm lockfile still resolves vulnerable
`@sveltejs/kit`@2.55.0; update all example project package.json entries that use
the specifier ^2.42.2 to require `@sveltejs/kit`@2.57.1 (or a range >=2.57.1),
bump or replace `@sveltejs/adapter-auto` to a version that depends on the newer
kit, then run pnpm install to regenerate pnpm-lock.yaml so all `@sveltejs/kit`
resolutions point to 2.57.1+ (alternatively add a pnpm overrides/resolutions
entry forcing `@sveltejs/kit`@2.57.1 and run pnpm install).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 03cc8224-594c-49f4-9c0b-7e3e9eff0314

📥 Commits

Reviewing files that changed from the base of the PR and between 0d63459 and ca39ee8.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • package.json

Comment thread package.json Outdated
@orbisai0security
Copy link
Copy Markdown
Author

Review Feedback Addressed

I've automatically addressed 1 review comment(s):

The PR incorrectly fixed CVE-2026-40073 by adding @sveltejs/kit@2.57.1 to a new top-level "dependencies" block in the root package.json. This is wrong for a private pnpm monorepo — adding a runtime dependencies entry to the root is a no-op for nested workspaces and is semantically incorrect.

The proper approach (as CodeRabbit flagged) is to add @sveltejs/kit to the existing pnpm.overrides section in root package.json, which forces all workspaces to resolve @sveltejs/kit to 2.57.1 regardless of what semver range they specify. The bogus top-level "dependencies" block is then removed.

Additionally, all 7 svelte example package.json files use "^2.42.2" for @sveltejs/kit, which resolves to the vulnerable 2.55.0. These are updated to "^2.57.1" so that even without the override they would pull in a safe version.

Files modified:

  • package.json
  • examples/svelte/ssr/package.json
  • examples/svelte/optimistic-updates/package.json
  • examples/svelte/star-wars/package.json
  • examples/svelte/basic/package.json
  • examples/svelte/auto-refetching/package.json
  • examples/svelte/load-more-infinite-scroll/package.json
  • examples/svelte/playground/package.json

The changes have been pushed to this PR branch. Please review!

@orbisai0security
Copy link
Copy Markdown
Author

Review Feedback Addressed

I've automatically addressed 1 review comment(s):

The package.json already correctly declares @sveltejs/kit: "2.57.1" inside pnpm.overrides — the right place for a pnpm monorepo-wide version pin. However, pnpm-lock.yaml still contains a stale dependencies: block under the root importer (.:), left over from when the package was incorrectly added to a top-level dependencies entry. Since there is no longer a runtime dependency on @sveltejs/kit at the workspace root, that 4-line dependencies block must be removed from the lockfile so it accurately reflects the current package.json.

Files modified:

  • pnpm-lock.yaml

The changes have been pushed to this PR branch. Please review!

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 22, 2026

🤖 Nx Cloud AI Fix Eligible

An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.

To disable these notifications, a workspace admin can disable them in workspace settings.


View your CI Pipeline Execution ↗ for commit 20a9297

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ❌ Failed 5m 25s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1m 52s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-22 19:22:05 UTC

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 22, 2026

More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@10637

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@10637

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@10637

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@10637

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@10637

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@10637

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@10637

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@10637

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@10637

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@10637

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@10637

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@10637

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@10637

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@10637

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@10637

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@10637

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@10637

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@10637

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@10637

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@10637

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@10637

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@10637

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@10637

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@10637

commit: 20a9297

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
examples/svelte/auto-refetching/package.json (1)

11-12: 💤 Low value

TanStack package updates appear unrelated to the CVE fix.

The PR title focuses on the SvelteKit CVE-2026-40073 security fix, but these lines also bump @tanstack/svelte-query and @tanstack/svelte-query-devtools from ^6.1.28 to ^6.1.31. Confirm whether these updates are intentionally included or should be separated into a different PR for clarity.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/svelte/auto-refetching/package.json` around lines 11 - 12, The bump
of `@tanstack/svelte-query` and `@tanstack/svelte-query-devtools` to ^6.1.31 is
unrelated to the SvelteKit CVE-2026-40073 fix; either remove or separate it: if
the tanstack updates are not intentionally part of this security PR, revert the
version changes for the two dependencies back to ^6.1.28 in package.json (look
for "`@tanstack/svelte-query`" and "`@tanstack/svelte-query-devtools`") or move
those two dependency bumps into a dedicated PR and leave this PR focused solely
on the CVE changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@examples/svelte/auto-refetching/package.json`:
- Around line 11-12: The bump of `@tanstack/svelte-query` and
`@tanstack/svelte-query-devtools` to ^6.1.31 is unrelated to the SvelteKit
CVE-2026-40073 fix; either remove or separate it: if the tanstack updates are
not intentionally part of this security PR, revert the version changes for the
two dependencies back to ^6.1.28 in package.json (look for
"`@tanstack/svelte-query`" and "`@tanstack/svelte-query-devtools`") or move those
two dependency bumps into a dedicated PR and leave this PR focused solely on the
CVE changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8f870bca-03d5-4e21-bbb4-36f46ff193c1

📥 Commits

Reviewing files that changed from the base of the PR and between ca39ee8 and 20a9297.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • examples/svelte/auto-refetching/package.json
  • examples/svelte/basic/package.json
  • examples/svelte/load-more-infinite-scroll/package.json
  • examples/svelte/optimistic-updates/package.json
  • examples/svelte/playground/package.json
  • examples/svelte/ssr/package.json
  • examples/svelte/star-wars/package.json
✅ Files skipped from review due to trivial changes (3)
  • examples/svelte/load-more-infinite-scroll/package.json
  • examples/svelte/playground/package.json
  • examples/svelte/basic/package.json

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.

2 participants