Описание
Sending a GET or HEAD request with a body crashes SvelteKit
Summary
In SvelteKit 2 sending a GET request with a body eg {} to a SvelteKit app in preview or with adapter-node throws Request with GET/HEAD method cannot have body. and crashes the app.
TRACE requests will also cause the app to crash. Prerendered pages and SvelteKit 1 apps are not affected.
PoC
First do a fresh install of SvelteKit 2 with the example app. Typescript.
npm run buildnpm run preview- Go to http://localhost:4173 (works)
- curl -X GET -d "{}" http://localhost:4173/bye
- Application crashes and http://localhost:4173 is down
Impact
Denial of Service for apps using adapter-node
Пакеты
@sveltejs/kit
>= 2.0.0, < 2.4.3
2.4.3
@sveltejs/adapter-node
>= 2.0.0, < 2.1.2
2.1.2
@sveltejs/adapter-node
>= 3.0.0, < 3.0.3
3.0.3
@sveltejs/adapter-node
= 4.0.0
4.0.1
Связанные уязвимости
SvelteKit is a web development kit. In SvelteKit 2, sending a GET request with a body eg `{}` to a built and previewed/hosted sveltekit app throws `Request with GET/HEAD method cannot have body.` and crashes the preview/hosting. After this happens, one must manually restart the app. `TRACE` requests will also cause the app to crash. Prerendered pages and SvelteKit 1 apps are not affected. `@sveltejs/adapter-node` versions 2.1.2, 3.0.3, and 4.0.1 and `@sveltejs/kit` version 2.4.3 contain a patch for this issue.