RubyGems
CVE-2026-141535
Addressable URI#hostname strips brackets from hosts that aren't IP literals
- Severity
- Low 3.7
- Published
- 1 Dec 2026
- Last changed
- 2 Dec 2026
- Added to UpHeron
- 2 Dec 2026
- Fixed in
- 2.10.0
- Attack
- Over the network · Only under certain conditions · No login needed · No user action needed
- Attacker can
- Read some data
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N- Also known as
- GHSA-c7j3-jq7p-v3pr
- Sources
- OSV.dev and GitHub
Description
Addressable::URI.parse accepts a host in brackets even when the text inside isn't an IPv6 address or an IPvFuture literal, such as http://[127.0.0.1]/ or http://[localhost]/. #host keeps the brackets, but #hostname strips them, so code that checks host and connects to hostname checks one name and connects to another. Net::HTTP connects to hostname when given an Addressable URI.
RFC 3986 §3.2.2 allows brackets only around an IP-literal: an IPv6 address or an IPvFuture literal (v1.…). Ruby's URI and curl reject anything else. The bracketed form of a name or IPv4 address doesn't resolve: IPAddr.new("[127.0.0.1]") raises and Resolv.getaddresses("[127.0.0.1]") returns [], while the stripped form resolves normally. A valid IPv6 literal such as [::1] isn't affected, because IPAddr accepts its bracketed form.
An application is affected if it:
Workarounds
- Check the same value used to connect: generally prefer hostname over host for SSRF checks, avoid checking host but then connecting to hostname, only connect to the same address that an SSRF check was performed on.
- Reject a URI whose host starts with [ unless IPAddr.new(uri.hostname) is an IPv6 address.
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-141537Addressable URI normalization takes quadratic time on long runs of combining marksLow 3.7 1 Dec 2026
- CVE-2026-141538Addressable URI userinfo setters store delimiters raw, so the serialized URI names a different hostMedium 4.8 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-141535
- GitHub Advisory Database https://github.com/advisories/GHSA-c7j3-jq7p-v3pr