LowGHSA-v6hg-69pc-4f3fCVE-2026-141537

Addressable URI normalization takes quadratic time on long runs of combining marks

Published 1 Dec 2026 · Updated 2 Dec 2026

Affected package

addressableRubyGems
Affected
>=2.0.0 <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

Normalizing a URI that contains a long run of combining marks takes time quadratic in the length of the run. A 16 kB path takes about 2 seconds of CPU time. The marks can also be pct-encoded, so a URI with only ASCII characters triggers it. An attacker who can submit a URI that an application normalizes, compares or matches against a template can hold a worker for seconds per request, and for over a minute with longer input. There is no confidentiality or integrity impact.

String#unicode_normalize orders the combining marks after a character with a loop that is quadratic in their number, and Addressable calls it on attacker-controlled text. It is reached from:

  • URI.normalize_component, so #normalize, #normalized_path and the other normalized_* methods, #==, #===, #display_uri, #route_from and #route_to
  • URI.normalized_encode
  • Template#expand, #match and #extract
  • IDNA.to_ascii with the pure-Ruby IDNA implementation, for hosts. With the native implementation (libidn), the host is linear.

URI.parse by itself doesn't normalize and is unaffected.

Affected Versions

This vulnerability affects Addressable >= 2.0.0. Versions 2.0.0 through 2.2.4 are affected on every Ruby. From 2.2.5 on, it affects only Rubies whose String#unicode_normalize has the quadratic loop: every Ruby 3.2 release and earlier, 3.3.0 through 3.3.10 and 3.4.0 through 3.4.7. Ruby 3.3.11, 3.4.8 and 4.0.0 fixed the loop. It is fixed in 2.10.0 on every Ruby, where a run of more than 30 combining marks, the limit of the Stream-Safe Text Format in UAX #15, is left as it is instead of being normalized. The text around it is normalized as before.

Workarounds

  • Upgrade to Ruby 3.3.11, 3.4.8, 4.0.0 or later, if you use Addressable 2.2.5 or later.
  • Otherwise, limit the length of URIs before normalizing them, or reject input with long runs of combining marks, such as /\p{M}{31,}/ after pct-decoding.

Proof of Concept

The script normalizes, compares and expands URIs with 8,000 combining marks, as they are and pct-encoded. It makes no network requests.

require "addressable/uri"
require "addressable/template"

def seconds
  started = Process.clock_gettime(Process::CLOCK_MONOTONIC)
  yield
  (Process.clock_gettime(Process::CLOCK_MONOTONIC) - started).round(2)
end

# Ruby caches each normalized unit, so each call uses different marks.
path = "\u0301\u0323" * 4000                # 16 kB
encoded = "%CC%80%CC%A4" * 4000             # 48 kB, ASCII only
value = "\u0302\u0325" * 4000

puts "ruby #{RUBY_VERSION}"
puts "normalize: #{seconds { Addressable::URI.parse("http://example.com/a#{path}").normalize }} s"
puts "==:        #{seconds { Addressable::URI.parse("http://example.com/a#{encoded}") == Addressable::URI.parse("http://example.com/") }} s"
puts "expand:    #{seconds { Addressable::Template.new("/{x}").expand("x" => "a#{value}") }} s"

Output with 2.9.2:

ruby 3.2.11
normalize: 2.08 s
==:        2.07 s
expand:    2.08 s

ruby 4.0.9
normalize: 0.01 s
==:        0.01 s
expand:    0.01 s

Output with the fix:

ruby 3.2.11
normalize: 0.01 s
==:        0.01 s
expand:    0.0 s

Credits

Reported by Patrik Ragnarsson (@dentarg), who also provided the fix.

For more information

If there are any questions or comments about this advisory:

Is GHSA-v6hg-69pc-4f3f 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
  • 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
  • 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.