Addressable pure IDNA implementation skips the nameprep bidi rule, so hosts under different domains can display identically
Published 1 Dec 2026 · Updated 1 Dec 2026
Affected package
- Affected
- >=2.0.0 <2.10.0
- Fixed in
- 2.10.0
bundle update --conservative addressable # Gemfile: '>= 2.10.0'Which addressable does your project really install?
Works for private projects: the file is read in memory to run the scan and then dropped. Also reads Gemfile.
Public repo?
Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Details
Impact
Nameprep, part of IDNA2003, requires a label with a right-to-left character to have no left-to-right characters, and to start and end with a right-to-left character (Section 6 of RFC 3491 and Section 6 of RFC 3454). Without the rule, two strings with the same characters in a different order can display identically. Addressable::IDNA.to_unicode in the pure-Ruby IDNA implementation, and so Addressable::URI#display_uri, doesn't apply the rule, so it decodes labels that break it. The native implementation, which uses libidn, applies the rule and isn't affected.
When a label is next to a right-to-left label, the bidirectional algorithm can display its digits or letters on the other side of the dot between them. A label that breaks the rule lets an attacker choose which side they end up on, so a host under a domain the attacker controls can display identically to a host under a different domain. xn--1-3mcxl0f.23.example, under 23.example, is displayed as 1شركة.23.example, which in a left-to-right context renders the same as شركة.123.example, a host under 123.example.
The practical risk is limited. The _target_ host has to have a right-to-left label with digits next to the dot on either side of it, such as 123 in شركة.123.example, and the attacker needs a domain whose name completes the target's, such as 23.example for a host under 123.example. A user has to trust the displayed host. The rule applies to each label separately, so even with it, two hosts made of valid labels can display identically, such as اب.1.example and 1.اب.example.
Affected Versions
This vulnerability affects Addressable >= 2.0.0 when the pure-Ruby IDNA implementation is in use, which is when the idn-ruby gem isn't installed. It is fixed in 2.10.0, where the pure-Ruby to_unicode returns a label that breaks the rule unchanged, as libidn does.
Workarounds
- Install libidn and the
idn-rubygem, so that Addressable uses the native IDNA implementation. - Don't make security decisions on
display_uriorto_unicodeoutput. Compare hosts usingnormalized_host.
Proof of Concept
require "addressable/uri" %w( https://xn--ogbpi5d.123.example/ https://xn--1-3mcxl0f.23.example/ ).each do |input| uri = Addressable::URI.parse(input) puts uri.display_uri.host end
With the pure-Ruby implementation, affected versions print two hosts that render identically in a left-to-right context:
شركة.123.example 1شركة.23.example
With the native implementation, or in fixed versions, the second line is xn--1-3mcxl0f.23.example.
Credits
Found by Bob Aman (@sporkmonger).
For more information
If there are any questions or comments about this advisory:
Is GHSA-fccw-gx6q-mh6c in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected addressable, and gives you the command that fixes it.
More advisories for addressable
- LowCVE-2026-141532Addressable URI#origin= takes the host from the userinfo · 2 Dec 2026
- LowCVE-2026-141536Addressable URI#request_uri returns control characters unencoded with possible HTTP request splitting · 1 Dec 2026
- LowCVE-2026-141535Addressable URI#hostname strips brackets from hosts that aren't IP literals · 1 Dec 2026
- LowCVE-2026-141537Addressable URI normalization takes quadratic time on long runs of combining marks · 1 Dec 2026
- MediumCVE-2026-141538Addressable URI userinfo setters store delimiters raw, so the serialized URI names a different host · 1 Dec 2026
- MediumCVE-2026-141539Addressable native IDNA backend truncates a host at a pct-encoded NUL when normalizing · 1 Dec 2026
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.