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
Published 2026-11-10 · Updated 2026-11-10 · Also known as GHSA-2j8w-xcrc-x985
Summary
Rack's host-related methods incorrectly return raw, unvalidated authority strings when input fails validation, allowing for potential URL injection. Developers using Rack 3.0.x or 3.2.x should update to the patched versions immediately to ensure security-sensitive URLs are handled correctly.
Who is affected
Affected deployments are those using Rack 3.1 or 3.2 where absolute URLs, redirects, or host-dependent logic rely on host_with_port, base_url, or url methods without an explicit host allowlist. When an attacker provides a malformed Host or forwarded header, the application may generate malicious URLs containing unexpected characters like @, /, or ?, leading to potential redirection or information injection vulnerabilities.
Exploitability
The vulnerability is rated as Medium with a CVSS 3.1 base score of 4.8, reflecting an attack that requires a high degree of complexity and no direct authentication. While the EPSS score of 0.002 indicates a low probability of exploitation, the vulnerability is not currently listed in the CISA Known Exploited Vulnerabilities catalog.
Remediation
- Update Rack to version 3.1.23 or 3.2.8.
- Enforce a strict host allowlist using Rack::Protection::HostAuthorization or reverse proxy configurations.
- Ensure reverse proxies are configured to overwrite untrusted X-Forwarded-Host or Forwarded headers.
How to check your project
- Check the Gemfile.lock file for 'rack' versions between 3.0.0 and 3.1.22 or 3.2.0 and 3.2.7.
- Use 'bundle info rack' in the terminal to verify the currently installed version.
Automated analysis of the published advisory data, generated 2026-11-19. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| RubyGems | rack |
>= 3.0.0, < 3.1.23 | 3.1.23 | bundle update rack |
| RubyGems | rack |
>= 3.2.0, < 3.2.8 | 3.2.8 | bundle update rack |
CVSS 3.1 vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
| Attack vector | Network |
|---|---|
| Attack complexity | High |
| Privileges required | None |
| User interaction | None |
| Scope | Unchanged |
| Confidentiality | Low |
| Integrity | Low |
| Availability | None |
FAQ
Is Rails affected by this vulnerability?
No, Rails overrides the affected methods in Action Dispatch and is not expected to be impacted.
Why is this considered an incomplete fix?
A previous fix (CVE-2026-34835) addressed host and hostname methods, but left host_with_port, base_url, and url returning unvalidated raw strings.
What happens if I am using Rack 2.2?
Rack 2.2 is affected as it never received the initial mitigation, meaning it continues to return raw values for all host methods.
Original advisory description
References
- WEB https://github.com/rack/rack/security/advisories/GHSA-2j8w-xcrc-x985
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2026-125109
- WEB https://github.com/rack/rack/commit/4380381a56dc52556a436d6d794c8e18dc8b0565
- WEB https://github.com/rack/rack/commit/49386f460286b7346c7003b69a839de782cc8a39
- PACKAGE https://github.com/rack/rack
- WEB https://github.com/rack/rack/releases/tag/v3.1.23
- WEB https://github.com/rack/rack/releases/tag/v3.2.8
- WEB https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rack/GHSA-2j8w-xcrc-x985.yml
Source records: GHSA-2j8w-xcrc-x985 (OSV.dev) · EPSS by FIRST, 2026-11-26.