Miggo Logo

CVE-2024-48913: Hono allows bypass of CSRF Middleware by a request without Content-Type header.

5.9

CVSS Score
3.1

Basic Information

EPSS Score
0.01712%
Published
10/15/2024
Updated
11/7/2024
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

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

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from how the CSRF middleware handles missing Content-Type headers. The original code used 'c.req.header('content-type') || ''' (line 76-89 in index.ts), which made requests without Content-Type headers pass the isRequestedByFormElementRe regex check. This allowed POST requests with empty/missing Content-Type to bypass CSRF validation. The patched version changes the default to 'text/plain' to properly enforce checks. The commit diff and vulnerability details directly point to this middleware handler as the vulnerable component.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Summ*ry *yp*ss *SR* Mi**l*w*r* *y * r*qu*st wit*out *ont*nt-Typ* **r***r. ### **t*ils *lt*ou** t** *sr* mi**l*w*r* v*ri*i*s t** *ont*nt-Typ* *****r, *ono *lw*ys *onsi**rs * r*qu*st wit*out * *ont*nt-Typ* *****r to ** s***. *ttps://*it*u*.*om/*o

Reasoning

T** vuln*r**ility st*ms *rom *ow t** *SR* mi**l*w*r* **n*l*s missin* *ont*nt-Typ* *****rs. T** ori*in*l *o** us** '*.r*q.*****r('*ont*nt-typ*') || ''' (lin* **-** in `in**x.ts`), w*i** m*** r*qu*sts wit*out *ont*nt-Typ* *****rs p*ss t** `isR*qu*st***