fix(deps): update dependency hono to v4 [security]#187
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
91296d7 to
4105ba0
Compare
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the
Comment |
40b4b3b to
220261d
Compare
6794a2b to
da69db9
Compare
6e1142f to
df59610
Compare
877b797 to
3765786
Compare
237f063 to
9a712fa
Compare
9a712fa to
d655c68
Compare
d655c68 to
c0a478b
Compare
c0a478b to
310bea1
Compare
310bea1 to
3936d9f
Compare
3936d9f to
dc5352f
Compare
dc5352f to
236ca53
Compare
236ca53 to
045fd96
Compare
045fd96 to
a827898
Compare
a827898 to
7dd7376
Compare
7dd7376 to
ec57e58
Compare
ec57e58 to
3f52bc2
Compare
3f52bc2 to
8f55711
Compare
8f55711 to
bbc8989
Compare
bbc8989 to
720a583
Compare
720a583 to
df8c55c
Compare
9c9b329 to
3e49d05
Compare
3e49d05 to
25057b6
Compare
25057b6 to
c9ca4fa
Compare
c9ca4fa to
17a48c6
Compare
17a48c6 to
ab563be
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
^2.3.0→^4.0.0Named path parameters can be overridden in TrieRouter
CVE-2023-50710 / GHSA-f6gv-hh8j-q8vq
More information
Details
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
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Hono vulnerable to Restricted Directory Traversal in serveStatic with deno
CVE-2024-32869 / GHSA-3mpf-rcc7-5347
More information
Details
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.txtsource
request
response is content of main.ts
Impact
Unexpected files are retrieved.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Hono CSRF middleware can be bypassed using crafted Content-Type header
CVE-2024-43787 / GHSA-rpfr-3m35-5vx5
More information
Details
Summary
Hono CSRF middleware can be bypassed using crafted Content-Type header.
Details
MIME types are case insensitive, but
isRequestedByFormElementReonly 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.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Hono allows bypass of CSRF Middleware by a request without Content-Type header.
CVE-2024-48913 / GHSA-2234-fmw7-43wr
More information
Details
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.
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:H/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
honojs/hono (hono)
v4.6.5Compare 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
honopackage immediately.Before this release, a request without a
Content-Typeheader can bypass the protection. This fix does not allow it. See: GHSA-2234-fmw7-43wrWhat's Changed
v2by @yusukebe in #3506Access-Control-Allow-Originif there is no matching origin by @uki00a in #3510New Contributors
Full Changelog: honojs/hono@v4.6.4...v4.6.5
v4.6.4Compare Source
What's Changed
crypto-jsfrom dev dependencies by @yusukebe in #3447createMiddlewareby @yusukebe in #3498globalThisby @sapphi-red in #3500overridetotoStringToBufferin classes extendingJSXNodeby @yusukebe in #3505New Contributors
Full Changelog: honojs/hono@v4.6.3...v4.6.4
v4.6.3Compare Source
This release has many new features, but each feature is small, so we've released it as a patch release.
What's Changed
runtime_teststoruntime-testsby @yusukebe in #3419everymiddleware work with short-circuiting middlewares by @paolostyle in #3441renderToStringby @usualoma in #3432New Contributors
Full Changelog: honojs/hono@v4.6.2...v4.6.3
v4.6.2Compare Source
What's Changed
Full Changelog: honojs/hono@v4.6.1...v4.6.2
v4.6.1Compare Source
What's Changed
New Contributors
Full Changelog: honojs/hono@v4.6.0...v4.6.1
v4.6.0Compare Source
Hono v4.6.0 is now available!
One of the highlights of this release is the Context Storage Middleware. Let's introduce it.
Context Storage Middleware
Many users may have been waiting for this feature. The Context Storage Middleware uses
AsyncLocalStorageto allow handling of the current Context object even outside of handlers.For example, let’s define a Hono app with a variable
message: string.To enable Context Storage Middleware, register
contextStorage()as middleware at the top and set themessagevalue.getContext()returns the current Context object, allowing you to get the value of themessagevariable outside the handler.In the case of Cloudflare Workers, you can also access the
Bindingsoutside the handler by using this middleware.Thanks @marceloverdijk !
New features
c.env.eventContextin handleMiddleware #3332WSContext#3337Content-Encodingwhenstreamis true #3355precompressedoption #3366Promise<string>or (async)JSX.ElementinstreamSSE#3344onFoundoption #3396Other changes
New Contributors
Full Changelog: honojs/hono@v4.5.11...v4.6.0
v4.5.11Compare Source
What's Changed
TwittertoXby @yusukebe in #3354New Contributors
Full Changelog: honojs/hono@v4.5.10...v4.5.11
v4.5.10Compare Source
What's Changed
New Contributors
Full Changelog: honojs/hono@v4.5.9...v4.5.10
v4.5.9Compare Source
What's Changed
NO_COLORby @ryuapp in #3306type(MIME) attribute types by @ssssota in #3305Full Changelog: honojs/hono@v4.5.8...v4.5.9
v4.5.8Compare Source
Security Fix for CSRF Protection Middleware
Before this release, in versions 4.5.7 and below, the CSRF Protection Middleware did not treat requests including
Content-Typeswith uppercase letters (e.g.,Application/x-www-form-urlencoded) as potential attacks, allowing them to pass.This could cause unexpected behavior, leading to a vulnerability. If you are using the CSRF Protection Middleware, please upgrade to version 4.5.8 or higher immediately.
For more details, see the report here: GHSA-rpfr-3m35-5vx5
v4.5.7Compare Source
What's Changed
targetandformtargetattribute types by @ssssota in #3299New Contributors
Full Changelog: honojs/hono@v4.5.6...v4.5.7
v4.5.6Compare Source
What's Changed
New Contributors
Full Changelog: honojs/hono@v4.5.5...v4.5.6
v4.5.5Compare Source
What's Changed
c.headerby @nakasyou in #3221c.headerby @nakasyou in #3255.and not end/by @yusukebe in #3256Full Changelog: honojs/hono@v4.5.4...v4.5.5
v4.5.4Compare Source
What's Changed
paraminValidationTargetssupports optional param by @yusukebe in #3229New Contributors
Full Changelog: honojs/hono@v4.5.3...v4.5.4
v4.5.3Compare Source
What's Changed
application/jsonwith a charset as JSON by @yusukebe in #3199self.fetchcorrectly by @yusukebe in #3200New Contributors
Full Changelog: honojs/hono@v4.5.2...v4.5.3
v4.5.2Compare Source
What's Changed
navigatorisundefinedby @yusukebe in #3171navigatorisundefinedby @yusukebe in #3173Full Changelog: honojs/hono@v4.5.1...v4.5.2
v4.5.1Compare Source
What's Changed
@experimentalfromcreateAppby @yusukebe in #3164queryinwsby @yusukebe in #3169New Contributors
Full Changelog: honojs/hono@v4.5.0...v4.5.1
v4.5.0Compare Source
Hono v4.5.0 is now available!
We have added three new built-in middleware. Now Hono is bringing 20 built-in middleware!
Amazing! These truly make Hono batteries-included framework.
Let's go through the new features in this release.
IP Restrict Middleware
Introducing IP Restrict Middleware. This middleware limits access to resources based on the IP address of the user.
Thanks @nakasyou!
Combine Middleware
Introducing Combine Middleware. This middleware combines multiple middleware functions into a single middleware, allowing you to create complex access controls by combining it with middleware like IP Restriction.
Thanks @usualoma!
Request ID Middleware
Introducing Request ID Middleware. This middleware generates a unique ID for each request, which you can use in your handlers.
Thanks @ryuapp!
Service Worker Adapter
A Service Worker adapter has been added, making it easier to run Hono applications as Service Workers.
For example, the following code works perfectly in a browser!
Thanks @nakasyou!
Cloudflare Pages Middleware
The Cloudflare Pages adapter now includes a
handleMiddlewarefunction, allowing many Hono middleware to run as Cloudflare Pages middleware.For example, to apply basic authentication, you can use the built-in middleware as shown below.
Thanks @BarryThePenguin!
React 19 Compatibility
Hono JSX now supports React 19 compatible APIs.
For example, the following hooks have been added:
useFormStatus()useActionState()useOptimistic()Additionally, rendering metadata within the
<head />tag is now supported. You can include elements like<title>,<meta>, and<link>within your components.The above will render the following HTML:
See all changes in this PR: #2960
Thanks @usualoma!
@hono/react-compatPlus, with the new
@hono/react-compat, you can alias thereactorreact-domused in your project to hono/jsx without any configuration.Passing
interfaceasBindings/VariablesYou can now pass
interfacetoBindingsorVariables. This allows you to use the type definitions generated by thewrangler typescommand directly.Previously, only type definitions using
typecould be passed toBindings. Now, interfaces like theEnvexample above can be used with generics.Thanks @ottomated!
Other features
getConnInfofor Vercel Adapter #3085getConnInfohelper for Lambda@Edge #3099All Updates
jsx/dom/servermodule for compatibility withreact-dom/serverby @usualoma in #2930unknownfrom AddressType by @yasuaki640 in #2958conninfo.test.tsby @yusukebe in #3059undefinedforAddressTypeby @yusukebe in #3112getConnInfofor vercel adapter by @promer94 in #3085getConnInfohelper for Lambda@Edge by @yasuaki640 in #3099interfaces as Bindings / Variables by @ottomated in #3136ContextVariableMapinContext<any>by @yusukebe in #3134New Contributors
Full Changelog: honojs/hono@v4.4.13...v4.5.0
v4.4.13Compare Source
What's Changed
string[] | File[]for RPC form value by @yusukebe in #3117app.use(path, mw)return correct schema type by @yusukebe in #3128Full Changelog: honojs/hono@v4.4.12...v4.4.13
v4.4.12Compare Source
What's Changed
pathwhen chaining afteruseby @yusukebe in #3087downloadattribute is set to a boolean value. by @oon00b in #3094@moduledocs by @yusukebe in #3101New Contributors
Full Changelog: honojs/hono@v4.4.11...v4.4.12
v4.4.11Compare Source
What's Changed
hono/clientby @naporin0624 in #3066HandlerInterface's(path, handler)s overloads down by @NamesMT in #3072New Contributors
Full Changelog: honojs/hono@v4.4.10...v4.4.11
v4.4.10Compare Source