Servers and applications
GHSA-4f37-qxr7-j52m
Missing `Vary: Accept` on some responses from routes with both a page and an endpoint enables shared cache poisoning
- Severity
- Medium 4.8
- Published
- 25 Nov 2026
- Last changed
- 25 Nov 2026
- Added to UpHeron
- 25 Nov 2026
- Fixed in
- 3.4.1
- Weakness
- CWE-349
- Attack
- Over the network · Only under certain conditions · No login needed · No user action needed
- Attacker can
- Change some data · Slow it down
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:L- Sources
- Project advisories (GitHub)
Description
When a route has both a +page and a +server file, SvelteKit serves either the page or the endpoint for GET and HEAD requests depending on the Accept request header, and adds Vary: Accept so that caches store the two responses separately. In some cases this header was missing:
- when the request handler threw an error, the resulting error response (which is also negotiated on Accept) did not include Vary: Accept
- when the application set its own vary header via setHeaders, it replaced Accept instead of being combined with it
If the affected responses are marked publicly cacheable (for example with setHeaders({ 'cache-control': 'public, ...' })) and served through a shared cache such as a CDN or reverse proxy, an unauthenticated user could cause the cache to store the endpoint's JSON response (or a JSON error) under the same key as the HTML page. Other visitors would then receive that response instead of the page until the cache entry expires, making the page unusable.
Workarounds
Avoid marking responses from routes that have both a page and an endpoint as publicly cacheable, or add Accept to the Vary header in the handle hook for those routes.
Affected software
| Software | Affected versions |
|---|---|
SvelteKitServers and applications · github:sveltejs/kit |
|
About SvelteKit
web development, streamlined
- Weekly downloads (npm)
- 5,128,894npm, 22 Nov 2026
- GitHub stars
- 20,926GitHub, 22 Nov 2026
- Forks
- 2,391GitHub, 22 Nov 2026
- Latest release
- @sveltejs/[email protected]GitHub, 22 Nov 2026
- Released
- 18 Nov 2026GitHub
- License
- MITGitHub
- First published on GitHub
- 15 Oct 2020GitHub
Vulnerabilities in SvelteKit
- In our list
- 38
- Published in the last 12 months
- 33
- Critical, last 12 months
- 0
- High, last 12 months
- 6
- Known exploited
- 0
- GHSA-59wf-wmcq-r5j8Memory exhaustion when reading remote functions `form` request bodies (experimental only)Medium 25 Nov 2026
- GHSA-c35j-4mwc-3m4jRepeated issue processing in remote form SSR can cause denial of service (experimental only)Medium 25 Nov 2026
- GHSA-ggm8-cv6q-2c35Stack trace handling in production can be made to read arbitrary server files, enabling DoSHigh 25 Nov 2026
- GHSA-5r92-qw5m-rwrrUnbounded array lengths in data parsed from a remote functions `form` enable DoSMedium 25 Nov 2026
- GHSA-x35v-76jc-m8f5ReDoS in SvelteKit route matching for routes with multiple paramsMedium 5.9 25 Nov 2026
- GHSA-cwcj-gpp3-m57mResponses with immutable headers crash adapter-node when `reroute` changes the pathname in apps without server routesLow 25 Nov 2026
References
- GitHub Advisory Database https://github.com/advisories/GHSA-4f37-qxr7-j52m
- github.com https://github.com/sveltejs/kit/security/advisories/GHSA-4f37-qxr7-j52m