CVE-2026-141532: Addressable URI#origin= takes the host from the userinfo
Impact
Addressable::URI#origin= extracts the host from the assigned origin with a pattern that stops at the first :. When the assigned value contains userinfo with a colon, the host is taken from the userinfo instead of the authority. Addressable::URI.parse reads the same string correctly, so an application that validates with parse and assigns with origin= (or the reverse) checks one host and uses another. Applications that don't pass untrusted values to origin= are unaffected.
origin= also truncated IPv6 hosts ([::1] became [) and dropped the port when a path followed. While this is not expected to have security impact, the same change fixes this bug as well.
Affected Versions
URI#origin= was introduced in Addressable 2.4.0, and the vulnerability is present in all versions with this method up through 2.9.2. It is fixed in 2.10.0.
Workarounds
- Don't pass untrusted values to origin=. Parse them with Addressable::URI.parse or Addressable::URI.heuristicparse and assign scheme, host and port individually if needed. - Reject origins that contain an @ character.
Credits
Reported by Praneeth (@praneeth-bala), UCSB SecLab.
Other sources
Addressable is an alternative implementation to the URI implementation that is part of Ruby's standard library. From 2.4.0 until 2.10.0, Addressable::URI#origin= parses an assigned origin with a pattern that can take the host from colon-containing userinfo instead of from the authority. An application that validates the same string with Addressable::URI.parse but assigns it with origin= can check one host and use another. This issue is fixed in version 2.10.0.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
rubygems/addressableto a version that resolves this vulnerability.Fixed in 2.10.0 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.10.0 - Compensating control
Until upgrading, do not pass untrusted values to Addressable::URI#origin= and reject origins containing `@`. Where needed, parse values with Addressable::URI.parse or Addressable::URI.heuristic_parse and assign scheme, host, and port individually.
Event History
Frequently Asked Questions
Which applications are realistically exposed to this issue?
Applications using Addressable versions from 2.4.0 up to, but not including, 2.10.0 are exposed if they validate a URI using Addressable::URI.parse and then assign the same value through Addressable::URI#origin=. The impact is host-validation bypass: the application can validate one host while using another.
What input is needed to exploit the issue?
The assigned origin must contain userinfo with a colon. Under the affected origin= parsing behavior, the host can be taken from that colon-containing userinfo rather than from the URI authority.
How can this be remediated?
Upgrade Addressable to version 2.10.0, which fixes the issue. If an upgrade cannot happen immediately, avoid relying on a host validation performed by Addressable::URI.parse when the URI will subsequently be assigned through origin=.