ADDRESSABLE · CVE-2026-126352 · Package
FIX → 2.9.1
Addressable's URI template matcher builds regular expressions that backtrack excessively when a template has several variables in one expression. A crafted URI passed to Template#match or Template#extract can tie up a thread for seconds, causing denial of service.
first public Oct 30, 2026 · 2 sources
Check it with your coding agent
It reads this page and tells you if your code or app is affected.
Applications that call Template#match or Template#extract from the addressable gem on user-supplied URIs, running on affected versions (2.3.2 through 2.9.0) under MRI Ruby below 3.3, JRuby, or TruffleRuby. The advisory states that code using only URI parsing or Template#expand is unaffected, and MRI Ruby 3.3 and later are not affected by any form.
Not affected if expand-only, mri-ruby-3.3-or-later, no-user-supplied-uris, uri-parsing-only
Who cares addressable, rails, ruby, rubygems
addressable and see whether it is at least 2.9.1.ruby -v to confirm the runtime; MRI Ruby 3.3 or later is not affected by any form, per the advisory.Template#match or Template#extract calls that process user-supplied URIs.Within the URI template implementation in Addressable, templates that put several variables in one expression generate regular expressions vulnerable to excessive backtracking:
+ and # (e.g., {/owner,repo,ref}, {.a,b}, {a,b,c}, {;a,b,c}). The values are joined by an optional separator, so a run of characters can be divided among the variables in O(n^k) ways for k variables.+ or # operators and many variables (e.g., {+v1,v2,v3,v4,v5,v6,v7,v8,v9,v10}). A failing match is exponential in the number of variables.{+a}{+b}{+c} or {a}{b}{c}), which are polynomial in the input length.When or is called with a maliciously crafted URI, this can result in uncontrolled resource consumption, leading to denial of service. A three-variable path template such as needs about 2 KB of input to occupy a thread for many seconds.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
InfraStack checks it against your stack and answers on your report, with the evidence and the fix.
Upgrade to 2.9.1
Template#matchTemplate#extracthttp://example.com/repos{/owner,repo,ref}Users of the URI parsing capabilities in Addressable but not the URI template matching capabilities are unaffected. Users who only call Template#expand are unaffected.
This vulnerability affects Addressable >= 2.3.0 (note: 2.3.0 and 2.3.1 were yanked; the earliest installable release is 2.3.2), including 2.9.0. It is fixed in 2.9.1.
The vulnerability is exploitable on Ruby implementations whose regular expression engine backtracks without memoization: MRI Ruby < 3.2 and JRuby. The second form, many-variable + and # expressions, is also exploitable on MRI Ruby 3.2, which does not memoize a regular expression that contains possessive quantifiers, and 2.9.0 generates those for these operators. It is also exploitable on TruffleRuby 40.0, whose regular expression engine falls back to backtracking for them. MRI Ruby 3.3 and later are not affected by any form, because they memoize those regular expressions too. TruffleRuby 40.0 is not affected by the other two forms. Earlier TruffleRuby versions were not tested.
This has been confirmed on the following runtimes with Addressable 2.9.0:
| Runtime | Status |
|---|---|
| MRI Ruby 2.7 | Vulnerable |
| MRI Ruby 3.1 | Vulnerable |
| MRI Ruby 3.2 | Vulnerable |
| MRI Ruby 3.3 | Not affected |
| MRI Ruby 3.4 | Not affected |
| MRI Ruby 4.0 | Not affected |
| JRuby 9.4 | Vulnerable |
| JRuby 10.1 | Vulnerable |
| TruffleRuby 40.0 | Vulnerable |
Template#match or Template#extract that processes user-supplied data.Reported by Matthew Mongeau (@halogenandtoast), Ruby Central Gem Security.
If there are any questions or comments about this advisory:
This page as .md · .json · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub Advisory Database, CC-BY 4.0 · NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.