BREW-TRAVIS-CVE-2026-125109 (GHSA-2J8W-XCRC-X985)

Vulnerability from osv_homebrew – Published: 2026-11-11 10:06 – Updated: 2026-11-11 10:06 – Source website
VLAI
Summary
Rack: Rack::Request#host_with_port (and #base_url / #url) return the raw invalid Host header — incomplete fix of CVE-2026-34835
Details

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.

{
  "affected": [
    {
      "ecosystem_specific": {
        "fix": null,
        "range_state": "affected",
        "resource": "rack",
        "resource_purl": "pkg:gem/rack@3.0.11",
        "upstream_fixed_in": "3.1.23"
      },
      "package": {
        "ecosystem": "Homebrew",
        "name": "travis",
        "purl": "pkg:brew/travis"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "1.14.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "database_specific": {
    "confidence": "high",
    "source": "matched",
    "strategy": "registry",
    "upstream_evidence": [
      {
        "ecosystem": "RubyGems",
        "key": "pkg:gem/rack@3.0.11",
        "name": "rack",
        "resource": "rack",
        "strategy": "registry",
        "subject_version": "3.0.11"
      }
    ]
  },
  "details": "## Summary\n\n`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.\n\nThis 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.\n\n## Details\n\n`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.\n\nFor 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.\n\n## Impact\n\nApplications 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`.\n\nRails 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.\n\n## Mitigation\n\n* 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\u0027s own name.\n* 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`.\n* Pin the authority with the `rack.request.config` `:authority` key where available.",
  "id": "BREW-travis-CVE-2026-125109",
  "modified": "2026-11-11T10:06:00Z",
  "published": "2026-11-11T10:06:00Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/rack/rack/security/advisories/GHSA-2j8w-xcrc-x985"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-125109"
    },
    {
      "type": "WEB",
      "url": "https://github.com/rack/rack/commit/4380381a56dc52556a436d6d794c8e18dc8b0565"
    },
    {
      "type": "WEB",
      "url": "https://github.com/rack/rack/commit/49386f460286b7346c7003b69a839de782cc8a39"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/rack/rack"
    },
    {
      "type": "WEB",
      "url": "https://github.com/rack/rack/releases/tag/v3.1.23"
    },
    {
      "type": "WEB",
      "url": "https://github.com/rack/rack/releases/tag/v3.2.8"
    },
    {
      "type": "WEB",
      "url": "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rack/GHSA-2j8w-xcrc-x985.yml"
    }
  ],
  "schema_version": "1.7.3",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Rack: Rack::Request#host_with_port (and #base_url / #url) return the raw invalid Host header \u2014 incomplete fix of CVE-2026-34835",
  "upstream": [
    "GHSA-2j8w-xcrc-x985",
    "CVE-2026-125109"
  ]
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…