Vulnerabilities in pkg:gem/rack
PACKAGECVE-2026-34835 is a MODERATE (CVSS 4.8) :request accepts invalid host characters, vulnerability (CWE-1286: Improper Validation of Syntactic Correctness of Input) affecting Rack libraries in the RubyGems ecosystem. The issue involves :request accepts invalid host characters, enabling host allowlist bypass. Remediation is available by upgrading affected packages to version 3.1.21, 3.2.6.
pkg:gem/rack
Vulnerability advisories affecting package pkg:gem/rack. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-g2pf-xv49-m2h5 | CVE-2026-34835 | MODERATE | Rack::Request accepts invalid Host characters, enabling host allowlist bypass |
| GHSA-q2ww-5357-x388 | CVE-2026-34831 | MODERATE | Rack has Content-Length mismatch in Rack::Files error responses |
| GHSA-qv7j-4883-hwh7 | CVE-2026-34830 | MODERATE | Rack::Sendfile header-based X-Accel-Mapping regex injection enables unauthorized X-Accel-Redirect |
| GHSA-8vqr-qjwx-82mw | CVE-2026-34829 | HIGH | Rack's multipart parsing without Content-Length header allows unbounded chunked file uploads |
| GHSA-v6x5-cg8r-vv6x | CVE-2026-34827 | HIGH | Rack's multipart header parsing allows Denial of Service via escape-heavy quoted parameters |
| GHSA-7mqq-6cf9-v2qp | CVE-2026-34763 | MODERATE | Rack has a root directory disclosure via unescaped regex interpolation in Rack::Directory |
| GHSA-v569-hp3g-36wr | CVE-2026-34230 | HIGH | Rack has quadratic complexity in Rack::Utils.select_best_encoding via wildcard Accept-Encoding header |
| GHSA-qfgr-crr9-7r49 | CVE-2026-32762 | MODERATE | Rack: Forwarded Header semicolon injection enables Host and Scheme spoofing |
| GHSA-rx22-g9mx-qrhv | CVE-2026-26962 | MODERATE | Rack's improper unfolding of folded multipart headers preserves CRLF in parsed parameter values |
| GHSA-vgpv-f759-9wx3 | CVE-2026-26961 | MODERATE | Rack's greedy multipart boundary parsing can cause parser differentials and WAF bypass. |
| GHSA-x8cg-fq8g-mxfx | CVE-2026-34826 | MODERATE | Rack's multipart byte range processing allows denial of service via excessive overlapping ranges |
| GHSA-q4qf-9j86-f5mh | CVE-2026-34786 | MODERATE | Rack:: Static header_rules bypass via URL-encoded paths |
| GHSA-h2jq-g4cq-5ppq | CVE-2026-34785 | HIGH | Rack::Static prefix matching can expose unintended files under the static root |
| GHSA-whrj-4476-wvmp | CVE-2026-25500 | MODERATE | Stored XSS in Rack::Directory via javascript: filenames rendered into anchor href |
| GHSA-mxw3-3hh2-x2mh | CVE-2026-22860 | HIGH | Rack has a Directory Traversal via Rack:Directory |
| GHSA-8cgq-6mh2-7j6v | CVE-2025-27111 | MODERATE | Escape Sequence Injection vulnerability in Rack lead to Possible Log Injection |
| GHSA-7wqh-767x-r66v | CVE-2025-27610 | HIGH | Local File Inclusion in Rack::Static |
| GHSA-7g2v-jj9q-g3rg | CVE-2025-25184 | MODERATE | Possible Log Injection in Rack::CommonLogger |
| GHSA-6xw4-3v39-52mm | CVE-2025-61919 | HIGH | Rack is vulnerable to a memory-exhaustion DoS through unbounded URL-encoded body parsing |
| GHSA-r657-rxjc-j557 | CVE-2025-61780 | MODERATE | Rack has a Possible Information Disclosure Vulnerability |
| GHSA-wpv5-97wm-hp9c | CVE-2025-61772 | HIGH | Rack's multipart parser buffers unbounded per-part headers, enabling DoS (memory exhaustion) |
| GHSA-w9pc-fmgc-vxvw | CVE-2025-61771 | HIGH | Rack: Multipart parser buffers large non‑file fields entirely in memory, enabling DoS (memory exhaustion) |
| GHSA-p543-xpfm-54cp | CVE-2025-61770 | HIGH | Rack's unbounded multipart preamble buffering enables DoS (memory exhaustion) |
| GHSA-625h-95r8-8xpm | CVE-2025-59830 | HIGH | Rack has an unsafe default in Rack::QueryParser allows params_limit bypass via semicolon-separated parameters |
| GHSA-47m2-26rw-j2jw | CVE-2025-49007 | MODERATE | ReDoS Vulnerability in Rack::Multipart handle_mime_head |
| GHSA-gjh7-p2fx-99vx | CVE-2025-46727 | HIGH | Rack has an Unbounded-Parameter DoS in Rack::QueryParser |
| GHSA-vpfw-47h7-xj4g | CVE-2025-32441 | MODERATE | Rack session gets restored after deletion |
| GHSA-3h57-hmj3-gj3p | CVE-2023-27530 | HIGH | Rack has possible DoS Vulnerability in Multipart MIME parsing |
| GHSA-65f5-mfpf-vfhj | CVE-2022-44570 | HIGH | Denial of service via header parsing in Rack |
| GHSA-hrqr-hxpp-chr3 | CVE-2019-16782 | MODERATE | Possible Information Leak / Session Hijack Vulnerability in Rack |
| GHSA-c6qg-cjj8-47qp | CVE-2023-27539 | LOW | Possible Denial of Service Vulnerability in Rack's header parsing |
| GHSA-cj83-2ww7-mvq7 | CVE-2024-39316 | MODERATE | Rack ReDoS Vulnerability in HTTP Accept Headers Parsing |
| GHSA-22f2-v57c-j9cx | CVE-2024-25126 | MODERATE | Rack vulnerable to ReDoS in content type parsing (2nd degree polynomial) |
| GHSA-54rr-7fvw-6x8f | CVE-2024-26146 | LOW | Rack Header Parsing leads to Possible Denial of Service Vulnerability |
| GHSA-xj5v-6v4g-jfw6 | CVE-2024-26141 | LOW | Rack has possible DoS Vulnerability with Range Header |
| GHSA-93pm-5p5f-3ghx | CVE-2022-44571 | LOW | Denial of Service Vulnerability in Rack Content-Disposition parsing |
| GHSA-rqv2-275x-2jq5 | CVE-2022-44572 | LOW | Denial of service via multipart parsing in Rack |
| GHSA-hxqx-xwvh-44m2 | CVE-2022-30122 | HIGH | Denial of Service Vulnerability in Rack Multipart Parsing |
| GHSA-3pxh-h8hw-mj8w | CVE-2013-0183 | MODERATE | Rack rubygems receiving excessively long lines triggers out-of-memory error |
| GHSA-5r2p-j47h-mhpg | CVE-2018-16471 | MODERATE | Rack vulnerable to Cross-site Scripting |
| GHSA-hg78-4f6x-99wq | CVE-2018-16470 | HIGH | Rack vulnerable to Denial of Service |
| GHSA-j6w9-fv6q-3q52 | CVE-2020-8184 | HIGH | Rack allows Percent-encoded cookies to overwrite existing prefixed cookie names |
| GHSA-85r7-w5mv-c849 | CVE-2013-0262 | MODERATE | Rack Vulnerable to Path Traversal |
| GHSA-h77x-m5q8-c29h | CVE-2012-6109 | MODERATE | Rack vulnerable to REDoS |
| GHSA-v6j3-7jrw-hq2p | CVE-2011-5036 | MODERATE | Rack Gem Subject to Denial of Service via Hash Collisions |
| GHSA-rgr4-9jh5-j4j6 | CVE-2015-3225 | MODERATE | Rack vulnerable to Denial of Service via large parameter depth request |
| GHSA-v882-ccj6-jc48 | CVE-2013-0184 | MODERATE | Rack vulnerable to Denial of Service |
| GHSA-wq4h-7r42-5hrr | CVE-2022-30123 | CRITICAL | Possible shell escape sequence injection vulnerability in Rack |
| GHSA-xc85-32mf-xpv8 | CVE-2013-0263 | MODERATE | Rack arbitrary code execution via timing attack |
| GHSA-5f9h-9pjv-v6j7 | CVE-2020-8161 | HIGH | Directory traversal in Rack::Directory app bundled with Rack |
| GHSA-9vc2-p34x-jhxh | - | MODERATE | Moderate severity vulnerability that affects rack |
CVE-2026-34835 at a Glance
Security Impact
CVSS: 4.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N).
How to Fix CVE-2026-34835
To remediate this vulnerability, upgrade all affected Rack dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade rack to 3.1.21
Upgrade rack to 3.2.6
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for rack
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-34835, inspect your project dependencies for Rack:
inspect dependencies for rack
Analyze the terminal output to locate any version of Rack in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.21), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1286: Improper Validation of Syntactic Correctness of Input, where the product receives input that is expected to be well-formed - i.e., to comply with a certain syntax - but it does not validate or incorrectly validates that the input complies with the syntax. In Rack, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-34835 Affected Rack Versions
2 component(s)References
Frequently Asked Questions
What is CVE-2026-34835?
Which Rack versions are affected?
What version fixes CVE-2026-34835?
Is rack affected?
What is the CVSS score of CVE-2026-34835?
What CWE is associated with CVE-2026-34835?
How can I check RubyGems dependencies for CVE-2026-34835?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-g2pf-xv49-m2h5",
"modified" : "2026-05-13T16:19:21Z",
"published" : "2026-04-02T20:36:40Z",
"aliases" : [ "CVE-2026-34835" ],
"summary" : "Rack::Request accepts invalid Host characters, enabling host allowlist bypass",
"details" : "## Summary\n\n`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.\n\nFor 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`.\n\nThis 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.\n\n## Details\n\n`Rack::Request` parses the authority component using logic equivalent to:\n\n```ruby\nAUTHORITY = /\n \\A\n (?<host>\n \\[(?<address>#{ipv6})\\]\n |\n (?<address>[[[:graph:]&&[^\\[\\]]]]*?)\n )\n (:(?<port>\\d+))?\n \\z\n/x\n```\n\nThe 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.\n\nAs a result, values such as the following are accepted and returned through `req.host`:\n\n```text\nmyapp.com@evil.com\nevil.com/myapp.com\nevil.com#myapp.com\n```\n\nApplications that attempt to allowlist hosts using string prefix or suffix checks may therefore treat attacker-controlled hosts as trusted. For example:\n\n```ruby\nreq.host.start_with?(\"myapp.com\")\n```\n\naccepts:\n\n```text\nmyapp.com@evil.com\n```\n\nand:\n\n```ruby\nreq.host.end_with?(\"myapp.com\")\n```\n\naccepts:\n\n```text\nevil.com/myapp.com\n```\n\nWhen those values are later used to build absolute URLs or enforce origin restrictions, the application may produce attacker-controlled results.\n\n## Impact\n\nApplications 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.\n\nIn 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.\n\nThe practical impact depends on application behavior. If the application or reverse proxy already enforces strict host validation, exploitability may be reduced or eliminated.\n\n## Mitigation\n\n* Update to a patched version of Rack that rejects invalid authority characters in `Host`.\n* Enforce strict `Host` header validation at the reverse proxy or load balancer.\n* Do not rely on prefix or suffix string checks such as `start_with?` or `end_with?` for host allowlisting.\n* Use exact host allowlists, or exact subdomain boundary checks, after validating that the host is syntactically valid.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "rack"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0.beta1"
}, {
"fixed" : "3.1.21"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "rack"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.2.0"
}, {
"fixed" : "3.2.6"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/rack/rack/security/advisories/GHSA-g2pf-xv49-m2h5"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-34835"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/rack/rack"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rack/CVE-2026-34835.yml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1286" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-02T20:36:40Z",
"nvd_published_at" : "2026-04-02T18:16:33Z"
}
}