MediumGHSA-mrrj-5mhw-rcf2CVE-2026-141539

Addressable native IDNA backend truncates a host at a pct-encoded NUL when normalizing

Published 1 Dec 2026 · Updated 2 Dec 2026

Affected package

addressableRubyGems
Affected
>=2.2.5 <2.10.0
Fixed in
2.10.0
Update to the fixed version for your release line, for example:bundle update --conservative addressable # Gemfile: '>= 2.10.0'

We confirm your address first. See our privacy policy.

Which addressable does your project really install?

Drop your Gemfile.lock hereWe find the exact addressable version you install, even when another package pulls it in, and tell you if it’s affected and what to run. Free, no sign-up.

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

With the native IDNA backend, which Addressable uses when the idn-ruby gem is installed, a host with a pct-encoded NUL is cut short when it is normalized. Addressable::URI#normalized_host decodes the host and passes each label to libidn, which reads the NUL as the end of the string and drops the rest of the label. http://internal.example%00x/ normalizes to http://internal.example/.

#host and #to_s keep the host as written, while #normalize, #normalized_host, #normalized_authority, #normalized_site, #origin and #display_uri give the shortened host, and #== treats the URI as equal to one with the shortened host. An application that checks one form and uses the other can be made to send a request to a host it meant to block: a denylist check of uri.host lets internal.example%00x through, and a request built from uri.normalize or uri.origin goes to internal.example. An application would need to mix the two to be vulnerable.

The pure-Ruby IDNA backend, used when idn-ruby isn't installed, keeps the NUL and isn't affected.

Affected Versions

This vulnerability affects Addressable >= 2.2.5 when the idn-ruby gem is installed. It is fixed in 2.10.0, where the native backend leaves a label with a NUL unchanged, as the pure-Ruby backend does.

Workarounds

  • Check the same host you use: if the request is made from uri.normalize or uri.origin, check uri.normalize.host, not uri.host.
  • Reject a URI whose host contains %00.
  • Remove the idn-ruby gem, so Addressable uses the pure-Ruby backend.

Credits

Found by Bob Aman (@sporkmonger).

For more information

If there are any questions or comments about this advisory:

Is GHSA-mrrj-5mhw-rcf2 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
  • LowCVE-2026-141531Addressable display_uri shows a deceptive label boundary for a host label that decodes to U+3002 · 1 Dec 2026
All 22 advisories for addressable

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.