CVE-2026-125109 — Vulnerability in rack — CVE Details
Rack: Rack::Request#host_with_port (and #base_url / #url) return the raw invalid Host header — incomplete fix of CVE-2026-34835
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.35%). Schedule for your next planned update.
Does your project use an affected rack version?
Paste your Gemfile.lock to check it for CVE-2026-125109 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
Rack::Request#host_with_port, and therefore #base_url and #url, return the raw authority string when it fails validation. An attacker-controlled Host, X-Forwarded-Host, or Forwarded: host= value containing characters that are not permitted in an authority is embedded verbatim in URLs generated by the application.
This completes the fix for CVE-2026-34835 (GHSA-g2pf-xv49-m2h5), which made #host and #hostname return nil for an invalid authority but left this path unchanged.
Details
Rack::Request#host_with_port splits the authority with split_authority. When the AUTHORITY pattern does not match, no components are returned and host_with_port falls back to returning the unvalidated authority string. base_url is "#{scheme}://#{host_with_port}" and url appends the full path, so both inherit the raw value.
For a request with Host: evil.com/@legit.com, host returns nil while host_with_port returns evil.com/@legit.com and base_url returns http://evil.com/@legit.com. A valid Host together with an invalid X-Forwarded-Host produces the same result, because forwarded headers take priority by default.
Impact
Applications that build absolute URLs, redirects, or origin-dependent checks from req.url, req.base_url, or req.host_with_port, and that do not enforce a host allowlist, may emit URLs containing attacker-chosen characters such as @, /, ?, #, spaces, or angle brackets. Generated links and Location headers can be redirected through userinfo tricks, string-based URL checks can be bypassed, and markup is reflected where the application does not escape the value. For example, redirect in Sinatra behind a proxy that forwards X-Forwarded-Host emits the raw invalid authority in Location.
Rails overrides these methods in Action Dispatch and is not expected to be affected. Rack 3.1 and 3.2 are affected. Rack 2.2 did not receive the CVE-2026-34835 change and returns the raw value from every host method.
Mitigation
- Update to a patched version of Rack, in which
host_with_portreturnsnilfor an invalid authority andbase_urlfalls back to the server's own name. - Enforce a host allowlist with
Rack::Protection::HostAuthorization,config.hostsin Rails, or at the reverse proxy, and configure the proxy to overwriteX-Forwarded-HostandForwarded. - Pin the authority with the
rack.request.config:authoritykey where available.
Advisory Timeline
- First published November 10, 2026 (16 days ago).
- Last revised November 10, 2026 — 0 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
gem install rack -v 3.1.23
gem install rack -v 3.2.8
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (2)
Affects 1 ecosystem: RubyGems (1).
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-1286
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 4.8 score means for each attack dimension.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
References
- https://github.com/rack/rack/security/advisories/GHSA-2j8w-xcrc-x985WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-125109ADVISORY
- https://github.com/rack/rack/commit/4380381a56dc52556a436d6d794c8e18dc8b0565WEB
- https://github.com/rack/rack/commit/49386f460286b7346c7003b69a839de782cc8a39WEB
- https://github.com/rack/rackPACKAGE
- https://github.com/rack/rack/releases/tag/v3.1.23WEB
- https://github.com/rack/rack/releases/tag/v3.2.8WEB
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rack/GHSA-2j8w-xcrc-x985.ymlWEB
Frequently Asked Questions
- What is CVE-2026-125109?
- Rack: Rack::Request#host_with_port (and #base_url / #url) return the raw invalid Host header — incomplete fix of CVE-2026-34835. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 4.8/10).
- How do I check if my project is affected by CVE-2026-125109?
- CVE-2026-125109 affects rack. It has a 0.4% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-125109 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
This is a below-median EPSS score — only 21.5% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-34230HIGH
Rack has quadratic complexity in Rack::Utils.select_best_encoding via wildcard Accept-Encoding header
- CVE-2026-34827HIGH
Rack's multipart header parsing allows Denial of Service via escape-heavy quoted parameters
- CVE-2025-61771HIGH
Rack: Multipart parser buffers large non‑file fields entirely in memory, enabling DoS (memory exhaustion)
- CVE-2026-32762MEDIUM
Rack: Forwarded Header semicolon injection enables Host and Scheme spoofing
- CVE-2026-34830MEDIUM
Rack::Sendfile header-based X-Accel-Mapping regex injection enables unauthorized X-Accel-Redirect
- CVE-2025-61780MEDIUM
Rack has a Possible Information Disclosure Vulnerability
- CVE-2026-26962MEDIUM
Rack's improper unfolding of folded multipart headers preserves CRLF in parsed parameter values
- CVE-2026-26961MEDIUM
Rack's greedy multipart boundary parsing can cause parser differentials and WAF bypass.