-
Notifications
You must be signed in to change notification settings - Fork 45
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
feat: validate incoming host header #163
Merged
yusukebe
merged 5 commits into
honojs:main
from
usualoma:fix-invalid-incoming-request-2
Apr 19, 2024
Merged
feat: validate incoming host header #163
yusukebe
merged 5 commits into
honojs:main
from
usualoma:fix-invalid-incoming-request-2
Apr 19, 2024
Conversation
This file contains 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
usualoma
force-pushed
the
fix-invalid-incoming-request-2
branch
from
April 19, 2024 12:22
0dd30a9
to
aed16dc
Compare
usualoma
force-pushed
the
fix-invalid-incoming-request-2
branch
from
April 19, 2024 12:24
aed16dc
to
a24d3ec
Compare
@yusukebe |
yusukebe
approved these changes
Apr 19, 2024
Hi @usualoma Thank you for handling it. I'll merge this and release the new version right now. The most important thing is to release it first. |
@yusukebe Thank you! |
nicolewhite
referenced
this pull request
in autoblocksai/cli
Apr 29, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@hono/node-server](https://togithub.com/honojs/node-server) | [`1.10.1` -> `1.11.1`](https://renovatebot.com/diffs/npm/@hono%2fnode-server/1.10.1/1.11.1) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@hono%2fnode-server/1.11.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@hono%2fnode-server/1.11.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@hono%2fnode-server/1.10.1/1.11.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@hono%2fnode-server/1.10.1/1.11.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>honojs/node-server (@​hono/node-server)</summary> ### [`v1.11.1`](https://togithub.com/honojs/node-server/releases/tag/v1.11.1) [Compare Source](https://togithub.com/honojs/node-server/compare/v1.11.0...v1.11.1) #### What's Changed - Update Request to work with ReadableStream polyfills by [@​nicksrandall](https://togithub.com/nicksrandall) in [https://github.com/honojs/node-server/pull/164](https://togithub.com/honojs/node-server/pull/164) - refactor(serve-static): use `c.req.path` instead of `url.pathname` by [@​yusukebe](https://togithub.com/yusukebe) in [https://github.com/honojs/node-server/pull/166](https://togithub.com/honojs/node-server/pull/166) #### New Contributors - [@​nicksrandall](https://togithub.com/nicksrandall) made their first contribution in [https://github.com/honojs/node-server/pull/164](https://togithub.com/honojs/node-server/pull/164) **Full Changelog**: honojs/node-server@v1.11.0...v1.11.1 ### [`v1.11.0`](https://togithub.com/honojs/node-server/releases/tag/v1.11.0) [Compare Source](https://togithub.com/honojs/node-server/compare/v1.10.1...v1.11.0) #### What's Changed - feat: validate incoming host header by [@​usualoma](https://togithub.com/usualoma) in [https://github.com/honojs/node-server/pull/163](https://togithub.com/honojs/node-server/pull/163) **Full Changelog**: honojs/node-server@v1.10.1...v1.11.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" in timezone America/Chicago, 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 this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/autoblocksai/cli). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMjEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjMyMS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This was referenced Sep 17, 2024
This was referenced Sep 18, 2024
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.
fixes #160, #161
What is this?
Validate the content of the host header of the request for security purposes.
Invalid values
If the following values are specified in the host header, a "400 Bad Request" is returned.
localhost/path
localhost?key=value
localhost<script>
Valid values
Host headers are only validated by character type, so "hostnames with invalid structure" or "hostnames that cannot be looked up" are considered valid and do not result in a "400 Bad Request". For example, the following host headers are considered valid
.
www...example.com
()
Default hostname
If you also want to accept HTTP 1.0 requests w/o Host header, you can call
serve()
as follows to ensure that the default hostname is used without error if there is no host header (or an empty string is specified).Tasks