Skip to main content

CVE-2026-125109 — Vulnerability in rack — CVE Details

MEDIUM

Rack: Rack::Request#host_with_port (and #base_url / #url) return the raw invalid Host header — incomplete fix of CVE-2026-34835

Published November 10, 2026Updated November 10, 2026Source: OSV

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.

Check my Gemfile.lock

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_port returns nil for an invalid authority and base_url falls back to the server's own name.
  • Enforce a host allowlist with Rack::Protection::HostAuthorization, config.hosts in Rails, or at the reverse proxy, and configure the proxy to overwrite X-Forwarded-Host and Forwarded.
  • Pin the authority with the rack.request.config :authority key 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.

Bundler
Update rack to 3.1.23 or later
gem install rack -v 3.1.23
Bundler
Update rack to 3.2.8 or later
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).

PackageFixed In
rack RubyGems · Affected: 3.0.0, 3.0.1, 3.0.10, 3.0.11 (+42 more)3.1.23
rack RubyGems · Affected: 3.2.0, 3.2.1, 3.2.2, 3.2.3 (+4 more)3.2.8

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 4.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N

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

CVSS Score
4.8

Exploitation requires specific conditions, or the impact is limited.

EPSS Score (30-day exploit probability)
0.35%
EPSS percentile: 21.5

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

GHSA-2j8w-xcrc-x985

Related CVEs

  • CVE-2026-34230
    HIGH

    Rack has quadratic complexity in Rack::Utils.select_best_encoding via wildcard Accept-Encoding header

  • CVE-2026-34827
    HIGH

    Rack's multipart header parsing allows Denial of Service via escape-heavy quoted parameters

  • CVE-2025-61771
    HIGH

    Rack: Multipart parser buffers large non‑file fields entirely in memory, enabling DoS (memory exhaustion)

  • CVE-2026-32762
    MEDIUM

    Rack: Forwarded Header semicolon injection enables Host and Scheme spoofing

  • CVE-2026-34830
    MEDIUM

    Rack::Sendfile header-based X-Accel-Mapping regex injection enables unauthorized X-Accel-Redirect

  • CVE-2025-61780
    MEDIUM

    Rack has a Possible Information Disclosure Vulnerability

  • CVE-2026-26962
    MEDIUM

    Rack's improper unfolding of folded multipart headers preserves CRLF in parsed parameter values

  • CVE-2026-26961
    MEDIUM

    Rack's greedy multipart boundary parsing can cause parser differentials and WAF bypass.

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Gemfile.lock