Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pluknet
Copy link
Contributor

@pluknet pluknet commented Nov 6, 2025

This series has some additional changes compared to previously posted on https://mailman.nginx.org/pipermail/nginx-devel/2024-June/KLY6JC27JZLSWBIOF6DT2FDDPIMDWWYK.html, most notably changes to stream, some minor though important fixes, rebase after c8c7beb and its proposed simplification via the ngx_http_validate_host() interface change.

See updated tests on my local branch:
https://github.com/pluknet/nginx-tests/tree/host

When the request line is in the absolute-URI form, a host identified
by a registered name (reg-name) is now restricted to start with an
alphanumeric character (see RFC 1123, RFC 3986).  Previously, empty
domain labels or host starting with a hyphen were accepted.

Additionally, host with a trailing dot is taken into account.
It is rewritten based on ngx_http_parse_request_line() state machine.
This introduces several hardening changes:
- host name with underscores is rejected
- a port subcomponent is restricted to digits
- for IP literals, a missing closing bracket and trailing dot are detected
Now that parsing of host in the absolute-URI form and as part of host
header validation was equalized, this makes subsequent validation of
host in absolute URIs unnecessary.

No functional changes intended.
@pluknet pluknet added this to the nginx-1.29.4 milestone Nov 6, 2025
@pluknet pluknet requested a review from arut November 6, 2025 10:13
@pluknet pluknet self-assigned this Nov 6, 2025
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