-
Notifications
You must be signed in to change notification settings - Fork 5
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
chore(deps): update dependency @sveltejs/kit to v2 [security] #978
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
267eaf2
to
58314fb
Compare
58314fb
to
3f22898
Compare
3f22898
to
d6fb4a4
Compare
d6fb4a4
to
f37f3c2
Compare
f37f3c2
to
b240513
Compare
b240513
to
2d52dce
Compare
2d52dce
to
0a425a4
Compare
Pull request was closed
07da92e
to
0a425a4
Compare
This PR contains the following updates:
^1.0.1
->^2.8.3
1.0.1
->2.8.3
GitHub Vulnerability Alerts
CVE-2023-29003
Summary
The SvelteKit framework offers developers an option to create simple REST APIs. This is done by defining a
+server.js
file, containing endpoint handlers for different HTTP methods.SvelteKit provides out-of-the-box cross-site request forgery (CSRF) protection to it’s users. The protection is implemented at
kit/src/runtime/server/respond.js#L52
. While the implementation does a sufficient job in mitigating common CSRF attacks, the protection can be bypassed by simply specifying a differentContent-Type
header value.Details
The CSRF protection is implemented using the code shown below.
If the incoming request specifies a POST method (1), the protection will compare the server’s origin with the value of the HTTP
Origin
header (2). A mismatch between these values signals that a potential attack has been detected. The final check is performed on the request’sContent-Type
header (3) whether the value is eitherapplication/x-www-form-urlencoded
ormultipart/form-data
(kit/src/utils/http.js#L71
). If all the previous checks pass, the request will be rejected with an 403 error response (4).The
is_form_content_type
validation is not sufficient to mitigate all possible variations of this type of attack. If a CSRF attack is performed with theContent-Type
header set totext/plain
, the protection will be circumvented and the request will be processed by the endpoint handler.Impact
If abused, this issue will allow malicious requests to be submitted from third-party domains, which can allow execution of operations within the context of the victim's session, and in extreme scenarios can lead to unauthorized access to users’ accounts.
Remediation
SvelteKit 1.15.1 updates the
is_form_content_type
function call in the CSRF protection logic to includetext/plain
.As additional hardening of the CSRF protection mechanism against potential method overrides, SvelteKit 1.15.1 is now performing validation on PUT, PATCH and DELETE methods as well. This latter hardening is only needed to protect users who have put in some sort of
?_method=
override feature themselves in theirhandle
hook, so that the request thatresolve
sees could bePUT
/PATCH
/DELETE
when the browser issues aPOST
request.CVE-2023-29008
Summary
The SvelteKit framework offers developers an option to create simple REST APIs. This is done by defining a
+server.js
file, containing endpoint handlers for different HTTP methods.SvelteKit provides out-of-the-box cross-site request forgery (CSRF) protection to its users. The protection is implemented at
kit/src/runtime/server/respond.js
. While the implementation does a sufficient job of mitigating common CSRF attacks, the protection can be bypassed by simply specifying an upper-casedContent-Type
header value. The browser will not send uppercase characters on form submission, but this check does not block all expected cross-site requests: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requestsDetails
The CSRF protection is implemented using the code shown below.
If the incoming request specifies a POST/PUT/PATCH/DELETE method, the protection will compare the server’s origin with the value of the HTTP Origin header. A mismatch between these values signals that a potential attack has been detected. The final check is performed on the request’s
Content-Type
header whether the value is eitherapplication/x-www-form-urlencoded
,multipart/form-data
ortext/plain
. If all the previous checks pass, the request will be rejected with an 403 error response.However,
is_form_content_type
, which is responsible for checking the value of theContent-Type
header, is not sufficient to mitigate all possible variations of this type of attack. Since this function is checkingContent-Type
with lower-cased values, and the browser accepts upper-casedContent-Type
header to be sent, a CSRF attack performed with theContent-Type
header that contains an upper-cased character (e.g.,text/plaiN
) can circumvent the protection and the request will be processed by the endpoint handler.Impact
If abused, this issue will allow malicious requests to be submitted from third-party domains, which can allow execution of operations within the context of the victim's session, and in extreme scenarios can lead to unauthorized access to users’ accounts. This may lead to all POST operations requiring authentication being allowed in the following cases:
SameSite=None
on its auth cookie and the user visits a malicious site in a Chromium-based browserSameSite
attribute explicitly and the user visits a malicious site with Firefox/Safari with tracking protections turned off.Remediations
It is preferred to update to SvelteKit 1.15.2. It is also recommended to explicitly set
SameSite
to a value other thanNone
on authentication cookies especially if the upgrade cannot be done in a timely manner.CVE-2024-53262
Summary
The static error.html template for errors contains placeholders that are replaced without escaping the content first.
Details
From https://kit.svelte.dev/docs/errors:
This leads to possible injection if an app explicitly creates an error with a message that contains user controlled content that ends up being something like this inside a server handle function:
Uncaught errors cannot be exploited like this, as they always render the message "Internal error".
Escaping the message string in the function that creates the html output can be done to improve safety for applications that are using custom errors on the server.
PoC
None provided
Impact
Only applications where user provided input is used in the
Error
message will be vulnerable, so the vast majority of applications will not be vulnerableCVE-2024-53261
Summary
"Unsanitized input from the request URL flows into
end
, where it is used to render an HTML page returned to the user. This may result in a Cross-Site Scripting attack (XSS)."Details
Source of potentially tainted data is in
packages/kit/src/exports/vite/dev/index.js
, line 437. This potentially tainted data is passed through a number of steps (which I could detail if you'd like) all the way down to line 91 inpackages/kit/src/exports/vite/utils.js
, which performs an operation that Snyk believes an attacker shouldn't be allowed to manipulate.Another source of potentially tainted data (according to Snyk) comes from
packages/kit/src/exports/vite/utils.js
, line 30, col 30 (i.e., theurl
property ofreq
). This potentially tainted data is passed through a number of steps (which I could detail if you'd like) all the way down line 91 inpackages/kit/src/exports/vite/utils.js
, which performs an operation that Snyk believes an attacker shouldn't be allowed to manipulate.PoC
Not provided
Impact
Little to none. The Vite development is not exposed to the network by default. And even if someone were able to trick a developer into executing an XSS against themselves, a development database should not have any sensitive data.
Release Notes
sveltejs/kit (@sveltejs/kit)
v2.8.3
Compare Source
Patch Changes
fix: ensure error messages are escaped (#13050)
fix: escape values included in dev 404 page (#13039)
v2.8.2
Compare Source
Patch Changes
fix: prevent duplicate fetch request when using Request with load function's fetch (#13023)
fix: do not override default cookie decoder to allow users to override the
cookie
library version (#13037)v2.8.1
Compare Source
Patch Changes
fix: only add nonce to
script-src-elem
,style-src-attr
andstyle-src-elem
CSP directives whenunsafe-inline
is not present (#11613)fix: support HTTP/2 in dev and production. Revert the changes from #12907 to downgrade HTTP/2 to TLS as now being unnecessary (#12989)
v2.8.0
Compare Source
Minor Changes
ActionFailure
objects (#12878)v2.7.7
Compare Source
Patch Changes
v2.7.6
Compare Source
Patch Changes
v2.7.5
Compare Source
Patch Changes
fix: warn on invalid cookie name characters (#12806)
fix: when using
@vitejs/plugin-basic-ssl
, set a no-op proxy config to downgrade from HTTP/2 to TLS sinceundici
does not yet enable HTTP/2 by default (#12907)v2.7.4
Compare Source
Patch Changes
fix: ensure element is focused after subsequent clicks of the same hash link (#12866)
fix: avoid preload if event default was prevented for
touchstart
andmousedown
events (#12887)fix: avoid reloading behaviour for hash links with data-sveltekit-reload if the hash is on the same page (#12866)
v2.7.3
Compare Source
Patch Changes
fix: include importer in illegal import error message (#12820)
fix: don't try reading assets directly that aren't present (#12876)
fix: decode non-latin characters when previewing prerendered pages (#12874)
fix: better error message when a
Result
is returned from a form action (#12829)docs: update URLs for new svelte.dev site (#12857)
v2.7.2
Compare Source
Patch Changes
v2.7.1
Compare Source
Patch Changes
chore: upgrade to sirv 3.0 (#12796)
fix: warn when form action responses are lost because SSR is off (#12063)
v2.7.0
Compare Source
Minor Changes
Patch Changes
fix: correctly handle relative paths when fetching assets on the server (#12113)
fix: decode non ASCII anchor hashes when scrolling into view (#12699)
fix: page response missing CSP and Link headers when return promise in
load
(#12418)v2.6.4
Compare Source
Patch Changes
fix: only preload links that have a different URL than the current page (#12773)
fix: revert change to replace version in generateBundle (#12779)
fix: catch stack trace fixing errors thrown in web containers (#12775)
fix: use absolute links in JSDoc comments (#12772)
v2.6.3
Compare Source
Patch Changes
fix: ensure a changing
version
doesn't affect the hashes for chunks without any actual code changes (#12700)fix: prevent crash when logging URL search params in a server load function (#12763)
chore: revert update dependency cookie to ^0.7.0 (#12767)
v2.6.2
Compare Source
Patch Changes
v2.6.1
Compare Source
Patch Changes
v2.6.0
Compare Source
Minor Changes
load
functions (#12716)Patch Changes
<form target="_blank">
and ` submissions (#11936)v2.5.28
Compare Source
Patch Changes
node:process
instead of using globals (#12641)v2.5.27
Compare Source
Patch Changes
fix: asynchronously instantiate components when using Svelte 5 (#12613)
fix: use
{@​render ...}
tag when generating default fallback page for svelte 5 apps (#12653)fix: emulate
event.platform
even when the route does not exist (#12513)v2.5.26
Compare Source
Patch Changes
v2.5.25
Compare Source
Patch Changes
6056ba30e29ac5747c356fbf1a42dd71f2c4aa1f
)v2.5.24
Compare Source
Patch Changes
v2.5.23
Compare Source
Patch Changes
root.svelte
instead ofsvelte:component
for svelte 5 (#12584)v2.5.22
Compare Source
Patch Changes
v2.5.21
Compare Source
Patch Changes
v2.5.20
Compare Source
Patch Changes
v2.5.19
Compare Source
Patch Changes
binding_non_reactive
warning in generated root component (you also need to update to[email protected]
) (#12524)v2.5.18
Compare Source
Patch Changes
fix: respect HTML attributes
enctype
andformenctype
for forms withuse:enhance
(#12198)fix: prevent client import error when a
hooks.server
file imports a private environment variable (#12195)fix: set default
Content-Type
header toapplication/x-www-form-urlencoded
forPOST
form submissions withuse:enhance
to align with native form behaviour (#12198)v2.5.17
Compare Source
Patch Changes
v2.5.16
Compare Source
Patch Changes
v2.5.15
Compare Source
Patch Changes
v2.5.14
Compare Source
Patch Changes
v2.5.13
Compare Source
Patch Changes
v2.5.12
Compare Source
Patch Changes
v2.5.11
Compare Source
Patch Changes
fix: hrefs that start with
config.prerender.origin
are now crawled (#12277)chore: add keywords for discovery in npm search (#12330)
fix: handle whitespace in HTTP Accept header (#12292)
v2.5.10
Compare Source
Patch Changes
fix: exclude server files from optimizeDeps.entries (#12242)
fix: bump import-meta-resolve to remove deprecation warnings (#12240)
v2.5.9
Compare Source
Patch Changes
fix: yield main thread before navigating (#12225)
fix: correctly handle aliases to files in the
.svelte-kit
directory (#12220)v2.5.8
Compare Source
Patch Changes
v2.5.7
Compare Source
Patch Changes
v2.5.6
Compare Source
Patch Changes
fetch
(#11904)v2.5.5
Compare Source
Patch Changes
v2.5.4
Compare Source
Patch Changes
data-sveltekit-preload-data
fails to fetch due to network error (#11944)v2.5.3
Compare Source
Patch Changes
fix: revert tsconfig change that includes svelte.config.js (#11908)
fix: exclude server worker from tsconfig again (#11727)
v2.5.2
Compare Source
Patch Changes
v2.5.1
Compare Source
Patch Changes
fix: prevent stale values after invalidation (#11870)
fix: prevent false positive
history.pushState
andhistory.replaceState
warnings (#11858)fix: relax status code types (#11781)
fix:
popstate
navigations takepushState
navigations into account (#11765)v2.5.0
Compare Source
Minor Changes
Patch Changes
/@​fs
prefix correctly on Windows when invokingread()
in dev mode (#11728)v2.4.3
Compare Source
Patch Changes
v2.4.2
Compare Source
Patch Changes
v2.4.1
Compare Source
Patch Changes
fix: use Vite's default value for
build.target
and respect override supplied by user (#11688)fix: properly decode base64 strings inside
read
(#11682)fix: default route config to
{}
for feature checking (#11685)fix: handle
onNavigate
callbacks correctly (#11678)v2.4.0
Compare Source
Minor Changes
$app/server
module withread
function for reading assets from filesystem (#11649)v2.3.5
Compare Source
Patch Changes
v2.3.4
Compare Source
Patch Changes
history
methods so other libs can monkeypatch it (#11657)v2.3.3
Compare Source
Patch Changes
__sveltekit/
module declarations from types (#11620)v2.3.2
Compare Source
Patch Changes
fix: return plaintext 404 for anything under appDir (#11597)
fix: populate dynamic public env without using top-level await, which fails in Safari (#11601)
v2.3.1
Compare Source
Patch Changes
fix: amend onNavigate type (#11599)
fix: better error message when peer dependency cannot be found (#11598)
v2.3.0
Compare Source
Minor Changes
reroute
hook (#11537)v2.2.2
Compare Source
Patch Changes
style-src
CSP directive whenunsafe-inline
is not present (#11575)v2.2.1
Compare Source
Patch Changes
feat: add CSP support for style-src-elem (#11562)
fix: address CSP conflicts with sha/nonce during dev (#11562)
v2.2.0
Compare Source
Minor Changes
$env/static/public
in service workers (#10994)Patch Changes
document.URL
contains credentials (#11179)v2.1.2
Compare Source
Patch Changes
v2.1.1
Compare Source
Patch Changes
fix: respect the trailing slash option when navigating from the basepath root page (#11388)
chore: shrink error messages shipped to client (#11551)
v2.1.0
Compare Source
Minor Changes
Patch Changes
v2.0.8
Compare Source
Patch Changes
fix: always scroll to top when clicking a # or #top link (
099608c428a49504785eab3afe3b2e76a9317bdf
)fix: add nonce or hash to "script-src-elem", "style-src-attr" and "style-src-elem" if defined in CSP config (#11485)
fix: decode server data with
stream: true
during client-side navigation (#11409)fix: capture scroll position when using
pushState
(#11540)chore: use peer dependencies when linked (#11433)
v2.0.7
Compare Source
Patch Changes
v2.0.6
Compare Source
Patch Changes
v2.0.5
Compare Source
Patch Changes
fix: render SPA shell when SSR is turned off and there is no server data (#11405)
fix: upgrade
sirv
andmrmime
to modernize javascript mime type (#11419)v2.0.4
Compare Source
Patch Changes
chore: update primary branch from master to main (
47779436c5f6c4d50011d0ef8b2709a07c0fec5d
)fix: adjust missing inner content warning (#11394)
fix: prevent esbuild adding phantom exports to service worker (#11400)
fix: goto type include state (#11398)
fix: ensure assets are served gzip in preview (#11377)
v2.0.3
Compare Source
Patch Changes
v2.0.2
Compare Source
Patch Changes
v2.0.1
Compare Source
Patch Changes
v2.0.0
Compare Source
Major Changes
breaking: remove top-level promise awaiting (#11176)
breaking: prevent use of dynamic env vars during prerendering, serve env vars dynamically (#11277)
breaking: remove deprecated
use:enhance
callback values (#11282)breaking: turn
error
andredirect
into commands (#11165)breaking: the type for
depends
now requires a:
as part of the string (#11201)breaking: remove baseUrl fallback from generated tsconfig (#11294)
breaking: fail if route with +page and +server is marked prerenderable (#11256)
breaking: remove
resolvePath
in favour ofresolveRoute
from$app/paths
(#11265)breaking: drop support for Svelte 3 (#11168)
breaking: require Vite 5.0.3+ (#11122)
breaking: generate
__data.json
files as sibling to.html
files (#11269)breaking: fail if +page and +server have mismatched config (#11256)
breaking: error if form without multipart/form-data enctype contains a file input (#11282)
breaking: require paths pass to preloadCode to be prefixed with basepath (#11259)
breaking:
@sveltejs/vite-plugin-svelte
is now a peer dependency and will need to be installed in each project using SvelteKit (#11184)breaking: stop re-exporting vitePreprocess (#11297)
breaking: require path option when setting/deleting/serializing cookies (#11240)
breaking: tighten up error handling (#11289)
breaking: remove state option from goto in favor of shallow routing (#11307)
breaking: disallow external navigation with
goto
(#11207)breaking: upgrade to TypeScript 5. Default
moduleResolution
tobundler
in user projects to be permissive in consuming andNodeNext
when runningpackage
to be strict in distributing (#11160)breaking: undefined is no longer a valid value for paths.relative (#11185)
breaking: require Node 18.13 or newer (#11172)
breaking: fix path resolution (#11276)
breaking: remove
dangerZone.trackServerFetches
(#11235)Minor Changes
feat: add untrack to load (#11311)
feat: implement shallow routing (#11307)
feat: provide SvelteKit html typings (#11222)
feat: redact internal stack trace when reporting config errors (#11292)
feat: allow for fine grained invalidation of search params (#11258)
Patch Changes
fix: prerender optional parameters as empty when
entries
contains'*'
(#11178)fix: resolve route config correctly (#11256)
fix: import Svelte types from svelte/compiler (#11188)
fix: reset invalid resources after a successful invalidation (#11268)
fix: Adjust fail method and ActionFailure type (#11260)
chore(deps): upgrade cookies dependency (#11189)
v1.30.4
Compare Source
Patch Changes
v1.30.3
Compare Source
Patch Changes
v1.30.2
Compare Source
Patch Changes
v1.30.1
Compare Source
Patch Changes
fix: prerendered root page with
paths.base
config uses correct trailing slash option (#10763)fix: correctly return 404 when a form action is not found (#11278)
v1.30.0
Compare Source
Minor Changes
response.arrayBuffer()
during ssr (#10535)Patch Changes
fix: allow
"false"
value for preload link options (#10555)fix: call worker
unref
instead ofterminate
(#10120)fix: correctly analyse exported server API methods during build (#11019)
fix: avoid error when back navigating before page is initialized (#10636)
fix: allow service-worker.js to import assets (#9285)
fix: distinguish better between not-found and internal-error (#11131)
v1.29.1
Compare Source
Patch Changes
fix: correctly return 415 when unexpected content types are submitted to actions (#11255)
chore: deprecate
preloadCode
calls with multiple arguments (#11266)v1.29.0
Compare Source
Minor Changes
resolveRoute
to$app/paths
, deprecateresolvePath
(#11261)v1.28.0
Compare Source
Minor Changes
Patch Changes
fix: resolve relative cookie paths before storing (#11253)
chore: deprecate cookies.set/delete without path option (#11237)
fix: make sure promises from fetch handle errors (#11228)
v1.27.7
Compare Source
Patch Changes
fix: set runes option in generated root (#11111)
fix: retain URL query string for trailing slash redirects to prerendered pages (#11142)
v1.27.6
Compare Source
Patch Changes
fix: use runes in generated root when detecting Svelte 5 (#11028)
fix: correctly prerender pages that use browser globals and have SSR turned off (#11032)
fix: correctly show 404 for prerendered dynamic routes when navigating client-side without a root layout server load (#11025)
v1.27.5
Compare Source
Patch Changes
fix: add vite.config.js to included files in generated tsconfig (#10788)
fix: cache location.origin on startup (#11004)
v1.27.4
Compare Source
Patch Changes
fix: generate
__data.json
for prerendered pages when SSR is turned off (#10988)chore: add experimental compatibility for Svelte 5 (#11002)
v1.27.3
Compare Source
Patch Changes
v1.27.2
Compare Source
Patch Changes
File
Node polyfill for Node version 18.11.0+ (#10948)v1.27.1
Compare Source
Patch Changes
v1.27.0
Compare Source
Minor Changes
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.