Loading advisory.
Loading advisory.
Rack::Request accepts invalid Host characters, enabling host allowlist bypass
Rack::Request parses the Host header using an AUTHORITY regular expression that accepts characters not permitted in RFC-compliant hostnames, including /, ?, #, and @. Because req.host returns the full parsed value, applications that validate hosts using naive prefix or suffix checks can be bypassed.
Published 2026-04-02 17:09 UTC · Modified 2026-09-10 03:50 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| rack | RubyGems | >= 3.0.0.beta1, < 3.1.21 >= 3.2.0, < 3.2.6 versions 3.0.0, 3.0.0.beta1, 3.0.0.rc1, 3.0.1, 3.0.10, 3.0.11, 3.0.12, 3.0.13, 3.0.14, 3.0.15, 3.0.16, 3.0.17, 3.0.18, 3.0.2, 3.0.3, 3.0.4, 3.0.4.1, 3.0.4.2, 3.0.5, 3.0.6 and 32 more | 3.1.21, 3.2.6 | gem install rack -v 3.1.21gem install rack -v 3.2.6 |
Rack::Request parses the Host header using an AUTHORITY regular expression that accepts characters not permitted in RFC-compliant hostnames, including /, ?, #, and @. Because req.host returns the full parsed value, applications that validate hosts using naive prefix or suffix checks can be bypassed.
For example, a check such as req.host.start_with?("myapp.com") can be bypassed with Host: myapp.com@evil.com, and a check such as req.host.end_with?("myapp.com") can be bypassed with Host: evil.com/myapp.com.
This can lead to host header poisoning in applications that use req.host, req.url, or req.base_url for link generation, redirects, or origin validation.
Rack::Request parses the authority component using logic equivalent to:
AUTHORITY = /
\A
(?<host>
\[(?<address>#{ipv6})\]
|
(?<address>[[[:graph:]&&[^\[\]]]]*?)
)
(:(?<port>\d+))?
\z
/xThe character class used for non-IPv6 hosts accepts nearly all printable characters except [ and ]. This includes reserved URI delimiters such as @, /, ?, and #, which are not valid hostname characters under RFC 3986 host syntax.
As a result, values such as the following are accepted and returned through req.host:
myapp.com@evil.com
evil.com/myapp.com
evil.com#myapp.comApplications that attempt to allowlist hosts using string prefix or suffix checks may therefore treat attacker-controlled hosts as trusted. For example:
req.host.start_with?("myapp.com")accepts:
myapp.com@evil.comand:
req.host.end_with?("myapp.com")accepts:
evil.com/myapp.comWhen those values are later used to build absolute URLs or enforce origin restrictions, the application may produce attacker-controlled results.
Applications that rely on req.host, req.url, or req.base_url may be affected if they perform naive host validation or assume Rack only returns RFC-valid hostnames.
In affected deployments, an attacker may be able to bypass host allowlists and poison generated links, redirects, or origin-dependent security decisions. This can enable attacks such as password reset link poisoning or other host header injection issues.
The practical impact depends on application behavior. If the application or reverse proxy already enforces strict host validation, exploitability may be reduced or eliminated.
Update to a patched version of Rack that rejects invalid authority characters in Host.
Enforce strict Host header validation at the reverse proxy or load balancer.
Do not rely on prefix or suffix string checks such as start_with? or end_with? for host allowlisting.
Use exact host allowlists, or exact subdomain boundary checks, after validating that the host is syntactically valid.
Exploit code or a detection template for this CVE is published by the sources below. This is not a report of use against real systems (that is what CISA KEV records) and it does not change the tier.
EPSS went from 0.002 on 2026-11-24 to 0.003 on 2026-11-30, over 3 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.002 | first score | v2026.06.15 |
| 2026-11-26 | 0.003 | 0.002 | v2026.06.15 |
| 2026-11-30 | 0.003 | 0.003 | v2026.06.15 |