chore(deps): update dependency @sveltejs/kit to 1.15.1 [security] #1557
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.15.0
->1.15.1
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.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.
This PR has been generated by Mend Renovate. View repository job log here.