Vulnerability GHSA-g2pf-xv49-m2h5

Medium Risk
MEDIUM RISK
CVSS Score: 4.8
Score Range: 4.0–6.9
Medium severity vulnerabilities (CVSS 4.0–6.9). Important issues that meaningfully reduce security confidence.
7 months ago
April 02, 2026 at 08:36 PM UTC
Rack::Request accepts invalid Host characters, enabling host allowlist bypass
3.0.0.beta1 and 3.0.0.rc1 and 3.0.0 - 3.0.4 and 3.0.4.1 and 3.0.4.2 and 3.0.5 - 3.0.6 and 3.0.6.1 and 3.0.7 - 3.0.9 and 3.0.9.1 and 3.0.10 - 3.2.5
3.0.0.beta1 and 3.0.0.rc1 and 3.0.0 - 3.0.4 and 3.0.4.1 and 3.0.4.2 and 3.0.5 - 3.0.6 and 3.0.6.1 and 3.0.7 - 3.0.9 and 3.0.9.1 and 3.0.10 - 3.2.5

Summary

Rack::Request accepts invalid Host characters, enabling host allowlist bypass

Details

Summary

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: [email protected], 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.

Details

Rack::Request parses the authority component using logic equivalent to:

AUTHORITY = /
  \A
  (?<host>
    \[(?<address>#{ipv6})\]
    |
    (?<address>[[[:graph:]&&[^\[\]]]]*?)
  )
  (:(?<port>\d+))?
  \z
/x

The 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:

[email protected]
evil.com/myapp.com
evil.com#myapp.com

Applications 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:

[email protected]

and:

req.host.end_with?("myapp.com")

accepts:

evil.com/myapp.com

When those values are later used to build absolute URLs or enforce origin restrictions, the application may produce attacker-controlled results.

Impact

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.

Mitigation

  • 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.

Related Vulnerabilities

Other vulnerabilities affecting the same packages

High Risk
9 hours ago
Rack: Multipart parsing allows DoS via unbounded scan buffer growth
0.1.0 - 0.4.0 and 0.9.0 - 1.1.0 and 1.1.1.pre and 1.1.1 - 1.2.8 and 1.3.0.beta and 1.3.0.beta2 and 1.3.0 - 1.4.7 and 1.5.0.beta.1 and 1.5.0.beta.2 and 1.5.0 - 1.5.5 and 1.6.0.beta and 1.6.0.beta2 and 1.6.0 - 1.6.13 and 2.0.0.alpha and 2.0.0.rc1 and 2.0.1 - 2.0.9 and 2.0.9.1 and 2.0.9.2 and 2.0.9.3 and 2.0.9.4 and 2.1.0 - 2.1.4 and 2.1.4.1 and 2.1.4.2 and 2.1.4.3 and 2.1.4.4 and 2.2.0 - 2.2.3 and 2.2.3.1 and 2.2.4 - 2.2.6 and 2.2.6.1 and 2.2.6.2 and 2.2.6.3 and 2.2.6.4 and 2.2.7 - 2.2.8 and 2.2.8.1 and 2.2.9 - 3.0.4 and 3.0.4.1 and 3.0.4.2 and 3.0.5 - 3.0.6 and 3.0.6.1 and 3.0.7 - 3.0.9 and 3.0.9.1 and 3.0.10 - 3.2.7 GHSA-5v64-555j-wjxm
0.1.0 - 0.4.0 and 0.9.0 - 1.1.0 and 1.1.1.pre and 1.1.1 - 1.2.8 and 1.3.0.beta and 1.3.0.beta2 and 1.3.0 - 1.4.7 and 1.5.0.beta.1 and 1.5.0.beta.2 and 1.5.0 - 1.5.5 and 1.6.0.beta and 1.6.0.beta2 and 1.6.0 - 1.6.13 and 2.0.0.alpha and 2.0.0.rc1 and 2.0.1 - 2.0.9 and 2.0.9.1 and 2.0.9.2 and 2.0.9.3 and 2.0.9.4 and 2.1.0 - 2.1.4 and 2.1.4.1 and 2.1.4.2 and 2.1.4.3 and 2.1.4.4 and 2.2.0 - 2.2.3 and 2.2.3.1 and 2.2.4 - 2.2.6 and 2.2.6.1 and 2.2.6.2 and 2.2.6.3 and 2.2.6.4 and 2.2.7 - 2.2.8 and 2.2.8.1 and 2.2.9 - 3.0.4 and 3.0.4.1 and 3.0.4.2 and 3.0.5 - 3.0.6 and 3.0.6.1 and 3.0.7 - 3.0.9 and 3.0.9.1 and 3.0.10 - 3.2.7 GHSA-5v64-555j-wjxm
Low Risk
9 hours ago
Rack: Multipart boundary ambiguity guard in Rack::Multipart::Parser can be bypassed with a quoted boundary value, allowing WAF bypass
0.1.0 - 0.4.0 and 0.9.0 - 1.1.0 and 1.1.1.pre and 1.1.1 - 1.2.8 and 1.3.0.beta and 1.3.0.beta2 and 1.3.0 - 1.4.7 and 1.5.0.beta.1 and 1.5.0.beta.2 and 1.5.0 - 1.5.5 and 1.6.0.beta and 1.6.0.beta2 and 1.6.0 - 1.6.13 and 2.0.0.alpha and 2.0.0.rc1 and 2.0.1 - 2.0.9 and 2.0.9.1 and 2.0.9.2 and 2.0.9.3 and 2.0.9.4 and 2.1.0 - 2.1.4 and 2.1.4.1 and 2.1.4.2 and 2.1.4.3 and 2.1.4.4 and 2.2.0 - 2.2.3 and 2.2.3.1 and 2.2.4 - 2.2.6 and 2.2.6.1 and 2.2.6.2 and 2.2.6.3 and 2.2.6.4 and 2.2.7 - 2.2.8 and 2.2.8.1 and 2.2.9 - 3.0.4 and 3.0.4.1 and 3.0.4.2 and 3.0.5 - 3.0.6 and 3.0.6.1 and 3.0.7 - 3.0.9 and 3.0.9.1 and 3.0.10 - 3.2.7 GHSA-p8x9-v4hv-2w4g
0.1.0 - 0.4.0 and 0.9.0 - 1.1.0 and 1.1.1.pre and 1.1.1 - 1.2.8 and 1.3.0.beta and 1.3.0.beta2 and 1.3.0 - 1.4.7 and 1.5.0.beta.1 and 1.5.0.beta.2 and 1.5.0 - 1.5.5 and 1.6.0.beta and 1.6.0.beta2 and 1.6.0 - 1.6.13 and 2.0.0.alpha and 2.0.0.rc1 and 2.0.1 - 2.0.9 and 2.0.9.1 and 2.0.9.2 and 2.0.9.3 and 2.0.9.4 and 2.1.0 - 2.1.4 and 2.1.4.1 and 2.1.4.2 and 2.1.4.3 and 2.1.4.4 and 2.2.0 - 2.2.3 and 2.2.3.1 and 2.2.4 - 2.2.6 and 2.2.6.1 and 2.2.6.2 and 2.2.6.3 and 2.2.6.4 and 2.2.7 - 2.2.8 and 2.2.8.1 and 2.2.9 - 3.0.4 and 3.0.4.1 and 3.0.4.2 and 3.0.5 - 3.0.6 and 3.0.6.1 and 3.0.7 - 3.0.9 and 3.0.9.1 and 3.0.10 - 3.2.7 GHSA-p8x9-v4hv-2w4g
Medium Risk
9 hours ago
Rack: Rack::Request#host_with_port (and #base_url / #url) return the raw invalid Host header — incomplete fix of CVE-2026-34835
3.0.0 - 3.0.4 and 3.0.4.1 and 3.0.4.2 and 3.0.5 - 3.0.6 and 3.0.6.1 and 3.0.7 - 3.0.9 and 3.0.9.1 and 3.0.10 - 3.2.7 GHSA-2j8w-xcrc-x985
3.0.0 - 3.0.4 and 3.0.4.1 and 3.0.4.2 and 3.0.5 - 3.0.6 and 3.0.6.1 and 3.0.7 - 3.0.9 and 3.0.9.1 and 3.0.10 - 3.2.7 GHSA-2j8w-xcrc-x985
Medium Risk
10 hours ago
Rack: Rack::Static header_rules bypass via dot-segment normalization mismatch
0.1.0 - 0.4.0 and 0.9.0 - 1.1.0 and 1.1.1.pre and 1.1.1 - 1.2.8 and 1.3.0.beta and 1.3.0.beta2 and 1.3.0 - 1.4.7 and 1.5.0.beta.1 and 1.5.0.beta.2 and 1.5.0 - 1.5.5 and 1.6.0.beta and 1.6.0.beta2 and 1.6.0 - 1.6.13 and 2.0.0.alpha and 2.0.0.rc1 and 2.0.1 - 2.0.9 and 2.0.9.1 and 2.0.9.2 and 2.0.9.3 and 2.0.9.4 and 2.1.0 - 2.1.4 and 2.1.4.1 and 2.1.4.2 and 2.1.4.3 and 2.1.4.4 and 2.2.0 - 2.2.3 and 2.2.3.1 and 2.2.4 - 2.2.6 and 2.2.6.1 and 2.2.6.2 and 2.2.6.3 and 2.2.6.4 and 2.2.7 - 2.2.8 and 2.2.8.1 and 2.2.9 - 3.0.4 and 3.0.4.1 and 3.0.4.2 and 3.0.5 - 3.0.6 and 3.0.6.1 and 3.0.7 - 3.0.9 and 3.0.9.1 and 3.0.10 - 3.2.7 GHSA-wvg4-6p58-3gh3
0.1.0 - 0.4.0 and 0.9.0 - 1.1.0 and 1.1.1.pre and 1.1.1 - 1.2.8 and 1.3.0.beta and 1.3.0.beta2 and 1.3.0 - 1.4.7 and 1.5.0.beta.1 and 1.5.0.beta.2 and 1.5.0 - 1.5.5 and 1.6.0.beta and 1.6.0.beta2 and 1.6.0 - 1.6.13 and 2.0.0.alpha and 2.0.0.rc1 and 2.0.1 - 2.0.9 and 2.0.9.1 and 2.0.9.2 and 2.0.9.3 and 2.0.9.4 and 2.1.0 - 2.1.4 and 2.1.4.1 and 2.1.4.2 and 2.1.4.3 and 2.1.4.4 and 2.2.0 - 2.2.3 and 2.2.3.1 and 2.2.4 - 2.2.6 and 2.2.6.1 and 2.2.6.2 and 2.2.6.3 and 2.2.6.4 and 2.2.7 - 2.2.8 and 2.2.8.1 and 2.2.9 - 3.0.4 and 3.0.4.1 and 3.0.4.2 and 3.0.5 - 3.0.6 and 3.0.6.1 and 3.0.7 - 3.0.9 and 3.0.9.1 and 3.0.10 - 3.2.7 GHSA-wvg4-6p58-3gh3
Medium Risk
7 months ago
Rack has Content-Length mismatch in Rack::Files error responses
0.1.0 - 0.4.0 and 0.9.0 - 1.1.0 and 1.1.1.pre and 1.1.1 - 1.2.8 and 1.3.0.beta and 1.3.0.beta2 and 1.3.0 - 1.4.7 and 1.5.0.beta.1 and 1.5.0.beta.2 and 1.5.0 - 1.5.5 and 1.6.0.beta and 1.6.0.beta2 and 1.6.0 - 1.6.13 and 2.0.0.alpha and 2.0.0.rc1 and 2.0.1 - 2.0.9 and 2.0.9.1 and 2.0.9.2 and 2.0.9.3 and 2.0.9.4 and 2.1.0 - 2.1.4 and 2.1.4.1 and 2.1.4.2 and 2.1.4.3 and 2.1.4.4 and 2.2.0 - 2.2.3 and 2.2.3.1 and 2.2.4 - 2.2.6 and 2.2.6.1 and 2.2.6.2 and 2.2.6.3 and 2.2.6.4 and 2.2.7 - 2.2.8 and 2.2.8.1 and 2.2.9 - 2.2.22 and 3.0.0.beta1 and 3.0.0.rc1 and 3.0.0 - 3.0.4 and 3.0.4.1 and 3.0.4.2 and 3.0.5 - 3.0.6 and 3.0.6.1 and 3.0.7 - 3.0.9 and 3.0.9.1 and 3.0.10 - 3.2.5 GHSA-q2ww-5357-x388
0.1.0 - 0.4.0 and 0.9.0 - 1.1.0 and 1.1.1.pre and 1.1.1 - 1.2.8 and 1.3.0.beta and 1.3.0.beta2 and 1.3.0 - 1.4.7 and 1.5.0.beta.1 and 1.5.0.beta.2 and 1.5.0 - 1.5.5 and 1.6.0.beta and 1.6.0.beta2 and 1.6.0 - 1.6.13 and 2.0.0.alpha and 2.0.0.rc1 and 2.0.1 - 2.0.9 and 2.0.9.1 and 2.0.9.2 and 2.0.9.3 and 2.0.9.4 and 2.1.0 - 2.1.4 and 2.1.4.1 and 2.1.4.2 and 2.1.4.3 and 2.1.4.4 and 2.2.0 - 2.2.3 and 2.2.3.1 and 2.2.4 - 2.2.6 and 2.2.6.1 and 2.2.6.2 and 2.2.6.3 and 2.2.6.4 and 2.2.7 - 2.2.8 and 2.2.8.1 and 2.2.9 - 2.2.22 and 3.0.0.beta1 and 3.0.0.rc1 and 3.0.0 - 3.0.4 and 3.0.4.1 and 3.0.4.2 and 3.0.5 - 3.0.6 and 3.0.6.1 and 3.0.7 - 3.0.9 and 3.0.9.1 and 3.0.10 - 3.2.5 GHSA-q2ww-5357-x388
View all vulnerabilities for these packages

Impacted packages

Timeline

Published
7 months ago
April 02, 2026 at 08:36 PM UTC
Fixed (3.1.21)
7 months ago
April 01, 2026 at 06:35 AM UTC
Fixed (3.2.6)
7 months ago
April 01, 2026 at 06:36 AM UTC
Last Modified
2 months ago
September 10, 2026 at 03:50 AM UTC