Vulnerability · Published Aug 22, 2024 · Assigned by GitHub_M
CVE-2024-43787Hono CSRF middleware can be bypassed using crafted Content-Type header
Medium 5.0
In plain English
A medium-severity cross-site request forgery in hono from honojs. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 16% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
Hono is a Web application framework that provides support for any JavaScript runtime. Hono CSRF middleware can be bypassed using crafted Content-Type header. MIME types are case insensitive, but isRequestedByFormElementRe only matches lower-case. As a result, attacker can bypass csrf middleware using upper-case form-like MIME type. This vulnerability is fixed in 4.5.8.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| npm | hono | 4.5.8 | GHSA-rpfr-3m35-5vx5 |
Affected products (as reported)
Weakness: CWE-352 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L
References
- https://github.com/honojs/hono/security/advisories/GHSA-rpfr-3m35-5vx5 x_refsource_CONFIRM
- https://github.com/honojs/hono/commit/41ce840379516410dee60c783142e05bb5a22449 x_refsource_MISC
- https://github.com/honojs/hono/blob/b0af71fbcc6dbe44140ea76f16d68dfdb32a99a0/src/middleware/csrf/index.ts#L16-L17 x_refsource_MISC