CVE-2026-34835
Rack: `Rack::Request` accepts invalid Host characters, enabling host allowlist bypass.
Rack is a modular Ruby web server interface. From versions 3.0.0.beta1 to before 3.1.21, and 3.2.0 to before 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. 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. This issue has been patched in versions 3.1.21 and 3.2.6.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
4.8
Rack: `Rack::Request` accepts invalid Host characters, enabling host allowlist bypass.
Rack is a modular Ruby web server interface. From versions 3.0.0.beta1 to before 3.1.21, and 3.2.0 to before 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. 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. This issue has been patched in versions 3.1.21 and 3.2.6.
- Record
CVE-2026-34835- CVSS 3.1
- 4.8 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N - Weakness
- CWE-1286
- Updated
- 2026-11-02
EUVDEUVD-2026-18478
4.8
Rack is a modular Ruby web server interface. From versions 3.0.0.beta1 to before 3.1.21, and 3.2.0 to before 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. 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. This issue has been patched in versions 3.1.21 and 3.2.6.
- Record
EUVD-2026-18478- CVSS 3.1
- 4.8 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-g2pf-xv49-m2h5
4.8
Rack::Request accepts invalid Host characters, enabling host allowlist bypass
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
Hostheader validation at the reverse proxy or load balancer. - Do not rely on prefix or suffix string checks such as
start_with?orend_with?for host allowlisting. - Use exact host allowlists, or exact subdomain boundary checks, after validating that the host is syntactically valid.
- Record
GHSA-g2pf-xv49-m2h5- CVSS 3.1
- 4.8 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N - Weakness
- CWE-1286
- Updated
- 2026-11-02
NVD
4.8
Rack is a modular Ruby web server interface. From versions 3.0.0.beta1 to before 3.1.21, and 3.2.0 to before 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. 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. This issue has been patched in versions 3.1.21 and 3.2.6.
- Record
CVE-2026-34835- CVSS 3.1
- 4.8 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N - CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Weakness
- CWE-1286
- Updated
- 2026-11-02
OSV
4.8
Rack: `Rack::Request` accepts invalid Host characters, enabling host allowlist bypass.
Rack is a modular Ruby web server interface. From versions 3.0.0.beta1 to before 3.1.21, and 3.2.0 to before 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. 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. This issue has been patched in versions 3.1.21 and 3.2.6.
- Record
CVE-2026-34835- CVSS 3.1
- 4.8 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N - Weakness
- CWE-1286
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-34835
6.5
Rack is a modular Ruby web server interface. From versions 3.0.0.beta1 to before 3.1.21, and 3.2.0 to before 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. 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. This issue has been patched in versions 3.1.21 and 3.2.6.
- Record
DEBIAN-CVE-2026-34835- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Updated
- 2026-11-02
Show 4 moreShow less
OSVGHSA-g2pf-xv49-m2h5
4.8
Rack::Request accepts invalid Host characters, enabling host allowlist bypass
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
Hostheader validation at the reverse proxy or load balancer. - Do not rely on prefix or suffix string checks such as
start_with?orend_with?for host allowlisting. - Use exact host allowlists, or exact subdomain boundary checks, after validating that the host is syntactically valid.
- Record
GHSA-g2pf-xv49-m2h5- CVSS 3.1
- 4.8 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N - Weakness
- CWE-1286
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-34835
4.8
Rack is a modular Ruby web server interface. From versions 3.0.0.beta1 to before 3.1.21, and 3.2.0 to before 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. 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. This issue has been patched in versions 3.1.21 and 3.2.6.
- Record
UBUNTU-CVE-2026-34835- CVSS 3.1
- 4.8 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N - CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Updated
- 2026-11-04
OSVMGASA-2026-0226 No score
Updated ruby-rack packages fix security vulnerabilities
CVE-2026-26961 Greedy multipart boundary parsing can cause parser
differentials and WAF bypass. Forwarded header semicolon injection
enables Host and Scheme spoofing.
CVE-2026-34230 Quadratic complexity in
Rack::Utils.select_best_encoding via wildcard Accept-Encoding
header.
CVE-2026-34763 Root directory disclosure via unescaped regex
interpolation in Rack::Directory.
CVE-2026-34785 Rack::Static prefix matching can expose unintended
files under the static root.
CVE-2026-34786 Rack::Static header_rules bypass via URL-encoded path
mismatch.
CVE-2026-34826 Multipart byte range processing allows denial of service
via excessive overlapping ranges.
CVE-2026-34827 Multipart header parsing allows denial of service via
escape-heavy quoted parameters.
CVE-2026-34829 Multipart parsing without Content-Length header allows
unbounded chunked file uploads.
CVE-2026-34830 Rack::Sendfile header-based X-Accel-Mapping regex
injection enables unauthorized X-Accel-Redirect.
CVE-2026-34831 Content-Length mismatch in Rack::Files error
responses.
CVE-2026-34835 Rack::Request accepts invalid Host characters, enabling
host allowlist bypass.
- Record
MGASA-2026-0226- Updated
- 2026-11-02
OSVUSN-8989-1 No score
ruby-rack vulnerabilities
Andrew Lacambra discovered that Rack did not properly parse certain regular expressions. An attacker could possibly use this issue to bypass network security filters. (CVE-2026-26961)
William T. Nelson discovered that Rack did not handle multipart headers correctly. An attacker could possibly use this issue to cause downstream parsing issues or a denial of service. (CVE-2026-26962)
It was discovered that Rack did not handle the Forwarded header correctly. An attacker could possibly use this issue to manipulate header values. (CVE-2026-32762)
It was discovered that Rack could consume excessive CPU when handling certain Accept-Encoding values. An attacker could possibly use this issue to cause a denial of service. (CVE-2026-34230)
Haruki Oyama discovered that certain configurations of Rack could erroneously fail to derive the displayed directory path, and expose the full file system path. An attacker could possibly use this issue to disclose deployment details such as layout and usernames. (CVE-2026-34763)
It was discovered that Rack did not properly handle static file paths. An attacker could possibly use this issue to exfiltrate unintentionally served data. (CVE-2026-34785)
Haruki Oyama discovered that Rack did not apply header rules to certain requests for URL-encoded static paths. An attacker could possibly use this issue to bypass security-relevant response headers. (CVE-2026-34786)
It was discovered that Rack did not limit the number of ranges requested in the Range header. An attacker could possibly use this issue to cause a denial of service. (CVE-2026-34826)
It was discovered that Rack could consume excessive CPU when parsing certain multipart parameters. An attacker could possibly use this issue to cause a denial of service. (CVE-2026-34827)
It was discovered that Rack could consume unbounded disk space when handling requests without a Content-Length header. An attacker could possibly use this issue to cause a denial of service. (CVE-2026-34829)
Mehtab Zafar discovered that Rack directly interpreted the X-Accel-Mapping header as a regular expression without escaping. An attacker could possibly use this issue to exfiltrate arbitrary files from internal locations. (CVE-2026-34830)
It was discovered that Rack did not properly handle messages with Unicode. An attacker could possibly use this issue to cause a denial of service. (CVE-2026-34831)
It was discovered that Rack did not properly parse the Host header. An attacker could possibly use this issue to bypass security filters or poison generated links. (CVE-2026-34835)
- Record
USN-8989-1- Updated
- 2026-11-04
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
rackRubyGems |
3.0.0.beta1 up to 3.1.21 | 3.1.21 |
rackRubyGems |
3.2.0 up to 3.2.6 | 3.2.6 |
ruby-rackDebian:13 |
before 3.1.20-0+deb13u2, plus listed versions 3.1.16-0.13.1.18-13.1.18-1~deb13u13.1.20-0+deb13u1 |
3.1.20-0+deb13u2 |
ruby-rackDebian:14 |
before 3.2.6-2, plus listed versions 3.1.16-0.13.1.18-13.1.18-1~deb13u13.2.4-13.2.5-13.2.5-23.2.6-1 |
3.2.6-2 |
rackRubyGems |
3.0.0.beta1 up to 3.1.21, plus listed versions 3.0.03.0.0.rc13.0.13.0.103.0.11 Show 40 moreShow less3.0.123.0.133.0.143.0.153.0.163.0.173.0.183.0.23.0.33.0.43.0.4.13.0.4.23.0.53.0.63.0.6.13.0.73.0.83.0.93.0.9.13.1.03.1.13.1.103.1.113.1.123.1.133.1.143.1.153.1.163.1.173.1.183.1.193.1.23.1.203.1.33.1.43.1.53.1.63.1.73.1.83.1.9 |
3.1.21 |
rackRubyGems |
3.2.0 up to 3.2.6, plus listed versions 3.2.13.2.23.2.33.2.43.2.5 |
3.2.6 |
ruby-rackMageia:9 |
before 2.2.23-1.mga9 | 2.2.23-1.mga9 |
ruby-rackUbuntu:25.10 |
before 3.1.16-0.1ubuntu0.3, plus listed versions 2.2.7-1.13.1.16-0.13.1.16-0.1ubuntu0.13.1.16-0.1ubuntu0.2 |
3.1.16-0.1ubuntu0.3 |
ruby-rackUbuntu:26.04:LTS |
before 3.2.4-1ubuntu1.1, plus listed versions 3.1.16-0.13.1.18-13.1.18-1build13.2.4-1ubuntu1 |
3.2.4-1ubuntu1.1 |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | Cyber-note/CVE-2026-34835-Black-box-Analysis | 2026-07-03 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, aliases, references | OSV | |
| affected, facts | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-34835 is a medium vulnerability (CVSS 4.8) in Rack, published April 2, 2026. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 0.20%, the 9th percentile. Fixed in rack 3.1.21.
References
github.com/rack/rack/security/advisories/GHSA-g2pf-xv49-m2h5
nvd.nist.gov/vuln/detail/CVE-2026-34835
github.com/rubysec/ruby-advisory-db/blob/master/gems/rack/CVE-2026-34835.yml
github.com/advisories/GHSA-g2pf-xv49-m2h5
github.com/CVEProject/cvelistV5/tree/main/cves/2026/34xxx/CVE-2026-34835.json
security-tracker.debian.org/tracker/CVE-2026-34835
Show 30 moreShow less
github.com/rack/rack
advisories.mageia.org/MGASA-2026-0226.html
bugs.mageia.org/show_bug.cgi?id=35446
github.com/rack/rack/security/advisories/GHSA-vgpv-f759-9wx3
github.com/rack/rack/security/advisories/GHSA-qfgr-crr9-7r49
github.com/rack/rack/security/advisories/GHSA-v569-hp3g-36wr
github.com/rack/rack/security/advisories/GHSA-7mqq-6cf9-v2qp
github.com/rack/rack/security/advisories/GHSA-h2jq-g4cq-5ppq
github.com/rack/rack/security/advisories/GHSA-q4qf-9j86-f5mh
github.com/rack/rack/security/advisories/GHSA-x8cg-fq8g-mxfx
github.com/rack/rack/security/advisories/GHSA-v6x5-cg8r-vv6x
github.com/rack/rack/security/advisories/GHSA-8vqr-qjwx-82mw
github.com/rack/rack/security/advisories/GHSA-qv7j-4883-hwh7
github.com/rack/rack/security/advisories/GHSA-q2ww-5357-x388
ubuntu.com/security/CVE-2026-34835
cve.org/CVERecord?id=CVE-2026-34835
ubuntu.com/security/notices/USN-8182-1
ubuntu.com/security/notices/USN-8989-1
ubuntu.com/security/CVE-2026-26961
ubuntu.com/security/CVE-2026-26962
ubuntu.com/security/CVE-2026-32762
ubuntu.com/security/CVE-2026-34230
ubuntu.com/security/CVE-2026-34763
ubuntu.com/security/CVE-2026-34785
ubuntu.com/security/CVE-2026-34786
ubuntu.com/security/CVE-2026-34826
ubuntu.com/security/CVE-2026-34827
ubuntu.com/security/CVE-2026-34829
ubuntu.com/security/CVE-2026-34830
ubuntu.com/security/CVE-2026-34831