Miggo Logo

CVE-2023-29008: SvelteKit framework has Insufficient CSRF protection for CORS requests

8.8

CVSS Score
3.1

Basic Information

EPSS Score
0.37655%
Published
4/7/2023
Updated
4/14/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
@sveltejs/kitnpm< 1.15.21.15.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the is_content_type function's case-sensitive comparison of Content-Type headers. The original implementation (types.includes(type)) failed to normalize header values, enabling attackers to bypass CSRF checks with non-lowercase MIME types. This is explicitly addressed in the patch by adding type.toLowerCase() before comparison. The commit diff shows this function was modified from export function is_content_type to a non-exported function with case normalization, and test cases were added to verify mixed-case Content-Type handling.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Summ*ry T** Sv*lt*Kit *r*m*work o***rs **v*lop*rs *n option to *r**t* simpl* R*ST *PIs. T*is is *on* *y ***inin* * `+s*rv*r.js` *il*, *ont*inin* *n*point **n*l*rs *or *i***r*nt *TTP m*t*o*s. Sv*lt*Kit provi**s out-o*-t**-*ox *ross-sit* r*qu*st *

Reasoning

T** vuln*r**ility st*ms *rom t** is_*ont*nt_typ* *un*tion's **s*-s*nsitiv* *omp*rison o* *ont*nt-Typ* *****rs. T** ori*in*l impl*m*nt*tion (typ*s.in*lu**s(typ*)) **il** to norm*liz* *****r v*lu*s, *n**lin* *tt**k*rs to *yp*ss *SR* ****ks wit* non-low