RubyGems
CVE-2026-141538
Addressable URI userinfo setters store delimiters raw, so the serialized URI names a different host
- Severity
- Medium 4.8
- Published
- 1 Dec 2026
- Last changed
- 2 Dec 2026
- Added to UpHeron
- 2 Dec 2026
- Fixed in
- 2.10.0
- Weakness
- CWE-436Injection (CWE-74)
- Attack
- Over the network · Only under certain conditions · No login needed · No user action needed
- Attacker can
- Read some data · Change some data
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N- Also known as
- GHSA-qrq6-rcpx-pmm6
- Sources
- OSV.dev and GitHub
Description
Addressable::URI#user=, #password=, #userinfo= and the matching Addressable::URI.new options store the value they are given without encoding or rejecting delimiters. A value containing /, ? or # ends the userinfo early when the URI is serialized, so #to_s names a different host than #host and #origin report.
The URI object keeps the component as assigned, and its own accessors agree with each other: host is the host the application set, and origin is built from it. #to_s joins the components with their delimiters but doesn't encode them, so user = "[email protected]/" serializes as https://[email protected]/@api.example.com/…. Addressable and Ruby's URI both read evil.example as the host of that string. A [ or ] in the userinfo makes the serialized URI fail to parse, a : in the user moves the rest of it into the password, and browsers read a \ as a /, ending the userinfo there. #normalize encodes all of these correctly.
Workarounds
- Serialize with uri.normalize.to_s, which encodes the delimiters, instead of uri.to_s.
- Encode userinfo values before assigning them, for example with Addressable::URI.encode_component(value, Addressable::URI::CharacterClasses::UNRESERVED).
- Check the host of the final string with Addressable::URI.parse(uri.to_s).host, not of the object.
Affected software
| Software | Affected versions |
|---|---|
addressableRubyGems · osv:RubyGems:addressable |
|
About addressable
- Total downloads (RubyGems)
- 1,323,514,580RubyGems, 1 Dec 2026
Vulnerabilities in addressable
- In our list
- 20
- Published in the last 12 months
- 20
- Critical, last 12 months
- 0
- High, last 12 months
- 0
- Known exploited
- 0
- CVE-2026-141532Addressable URI#origin= takes the host from the userinfoLow 3.7 2 Dec 2026
- CVE-2026-141536Addressable URI#request_uri returns control characters unencoded with possible HTTP request splittingLow 3.7 1 Dec 2026
- CVE-2026-141535Addressable URI#hostname strips brackets from hosts that aren't IP literalsLow 3.7 1 Dec 2026
- CVE-2026-141537Addressable URI normalization takes quadratic time on long runs of combining marksLow 3.7 1 Dec 2026
- CVE-2026-141539Addressable native IDNA backend truncates a host at a pct-encoded NUL when normalizingMedium 4.8 1 Dec 2026
- CVE-2026-141531Addressable display_uri shows a deceptive label boundary for a host label that decodes to U+3002Low 3.1 1 Dec 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-141538
- GitHub Advisory Database https://github.com/advisories/GHSA-qrq6-rcpx-pmm6