Update dependency hono to v3.11.7 [SECURITY] #472
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
3.11.4
->3.11.7
GitHub Vulnerability Alerts
CVE-2023-50710
Impact
The clients may override named path parameter values from previous requests if the application is using TrieRouter. So, there is a risk that a privileged user may use unintended parameters when deleting REST API resources.
TrieRouter is used either explicitly or when the application matches a pattern that is not supported by the default RegExpRouter.
The code to reproduce it. The server side application:
The client code which makes requests to the server application:
The results:
Patches
"v3.11.7" includes the change to fix this issue.
Workarounds
Don't use TrieRouter directly.
References
Router options on the Hono website: https://hono.dev/api/hono#router-option
CVE-2024-32869
Summary
When using serveStatic with deno, it is possible to directory traverse where main.ts is located.
My environment is configured as per this tutorial
https://hono.dev/getting-started/deno
PoC
$ tree . ├── deno.json ├── deno.lock ├── main.ts ├── README.md └── static └── a.txt
source
request
response is content of main.ts
Impact
Unexpected files are retrieved.
CVE-2024-43787
Summary
Hono CSRF middleware can be bypassed using crafted Content-Type header.
Details
MIME types are case insensitive, but
isRequestedByFormElementRe
only matches lower-case.https://github.com/honojs/hono/blob/b0af71fbcc6dbe44140ea76f16d68dfdb32a99a0/src/middleware/csrf/index.ts#L16-L17
As a result, attacker can bypass csrf middleware using upper-case form-like MIME type, such as "Application/x-www-form-urlencoded".
PoC
Impact
Bypass csrf protection implemented with hono csrf middleware.
Discussion
I'm not sure that omitting csrf checks for Simple POST request is a good idea.
CSRF prevention and CORS are different concepts even though CORS can prevent CSRF in some cases.
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
Similarly, the fetch API does not add a Content-Type header for requests that do not include a Body.
Impact
Bypass csrf protection implemented with hono csrf middleware.
Release Notes
honojs/hono (hono)
v3.11.7
Compare Source
Security Update
This release includes a security patch that fixes the vulnerability in TrieRouter.
If you are using the default preset or
hono/quick
, or specifying the router asTrieRouter
, you must upgrade to this version3.11.7
immediately.How to upgrade
For Deno
Just increment the version specifier to
v3.11.7
.For Node.js
Upgrade the
hono
package via npm:You may not update the
hono
package withnpm update
, so please usenpm install
.The vulnerability detail
The clients may override named path parameter values from previous requests if the application is using TrieRouter. So, there is a risk that a privileged user may use unintended parameters when deleting REST API resources.
TrieRouter is used either explicitly or when the application matches a pattern that is not supported by the default RegExpRouter.
The advisory: GHSA-f6gv-hh8j-q8vq
Our Approach to Security
If you discover such a vulnerability, please contact us immediately. We will respond immediately; we have enabled GitHub's private vulnerability reporting feature, so please use that.
https://github.com/honojs/hono/security/advisories
Thanks.
Full Changelog: honojs/hono@v3.11.6...v3.11.7
v3.11.6
Compare Source
What's Changed
status
correctly by @yusukebe in https://github.com/honojs/hono/pull/1814Full Changelog: honojs/hono@v3.11.5...v3.11.6
v3.11.5
Compare Source
What's Changed
hono/tiny
size by @ryuapp in https://github.com/honojs/hono/pull/1809c.json()
allows object and returns JSONParsed by @yusukebe in https://github.com/honojs/hono/pull/1806New Contributors
Full Changelog: honojs/hono@v3.11.4...v3.11.5
Configuration
📅 Schedule: Branch creation - "" (UTC), 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 this update again.
This PR was generated by Mend Renovate. View the repository job log.