CVE-2024-48913: Hono allows bypass of CSRF Middleware by a request without Content-Type header.
5.9
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.01712%
CWE
Published
10/15/2024
Updated
11/7/2024
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:H/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| hono | npm | < 4.6.5 | 4.6.5 |
Vulnerability Intelligence
Miggo AI
Root 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.