CVE-2026-35611: Addressable has a Regular Expression Denial of Service in Addressable templates

Published Apr 7, 2026
·
Updated

Impact

Within the URI template implementation in Addressable, two classes of URI template generate regular expressions vulnerable to catastrophic backtracking:

1. Templates using the (explode) modifier with any expansion operator (e.g., {foo}, {+var}, {#var}, {/var}, {.var}, {;var}, {?var}, {&var}) generate patterns with nested unbounded quantifiers that are O(2^n) when matched against a maliciously crafted URI. 2. Templates using multiple variables with the + or # operators (e.g., {+v1,v2,v3}) generate patterns with O(n^k) complexity due to the comma separator being within the matched character class, causing ambiguous backtracking across k variables.

When matched against a maliciously crafted URI, this can result in catastrophic backtracking and uncontrolled resource consumption, leading to denial of service. The first pattern was partially addressed in 2.8.10 for certain operator combinations. Both patterns are fully remediated in 2.9.0.

Users of the URI parsing capabilities in Addressable but not the URI template matching capabilities are unaffected.

Affected Versions

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). It was partially fixed in version 2.8.10 and fully remediated in 2.9.0.

The vulnerability is more exploitable on MRI Ruby < 3.2 and on all versions of JRuby and TruffleRuby. MRI Ruby 3.2 and later ship with Onigmo 6.9, which introduces memoization that prevents catastrophic backtracking for the first class of template. JRuby and TruffleRuby do not implement equivalent memoization and remain vulnerable to all patterns.

This has been confirmed on the following runtimes:

| Runtime | Status | |---------|--------| | MRI Ruby 2.6 | Vulnerable | | MRI Ruby 2.7 | Vulnerable | | MRI Ruby 3.0 | Vulnerable | | MRI Ruby 3.1 | Vulnerable | | MRI Ruby 3.2 | Partially vulnerable | | MRI Ruby 3.3 | Partially vulnerable | | MRI Ruby 3.4 | Partially vulnerable | | MRI Ruby 4.0 | Partially vulnerable | | JRuby 10.0 | Vulnerable | | TruffleRuby 21.2 | Vulnerable |

Workarounds

- Upgrade to MRI Ruby 3.2 or later, if your application does not use JRuby or TruffleRuby. The Onigmo memoization introduced in MRI Ruby 3.2 prevents catastrophic backtracking from nested unbounded quantifiers (pattern 1 above — templates using the modifier). It does not reliably mitigate the O(n^k) multi-variable case (pattern 2), so upgrading Ruby alone may not be sufficient if your templates use {+v1,v2,...} or {#v1,v2,...} syntax.

- Avoid using vulnerable template patterns when matching user-supplied input on unpatched versions of the library: - Templates using the (explode) modifier: {foo}, {+var}, {#var}, {.var}, {/var}, {;var}, {?var}, {&var} - Templates using multiple variables with the + or # operators: {+v1,v2}, {#v1,v2,v3}, etc.

- Apply a short timeout around any call to Template#match or Template#extract that processes user-supplied data.

References

- https://owasp.org/www-community/attacks/RegularexpressionDenialofService-ReDoS - https://cwe.mitre.org/data/definitions/1333.html - https://www.regular-expressions.info/catastrophic.html

Credits

Discovered in collaboration with @jamfish.

For more information

If you have any questions or comments about this advisory: Open an issue

Other sources

Addressable has a Regular Expression Denial of Service in Addressable templates

Microsoft

Addressable is an alternative implementation to the URI implementation that is part of Ruby's standard library. From 2.3.0 to before 2.9.0, within the URI template implementation in Addressable, two classes of URI template generate regular expressions vulnerable to catastrophic backtracking. Templates using the (explode) modifier with any expansion operator (e.g., {foo}, {+var}, {#var}, {/var}, {.var}, {;var}, {?var}, {&var}) generate patterns with nested unbounded quantifiers that are O(2^n) when matched against a maliciously crafted URI. Templates using multiple variables with the + or # operators (e.g., {+v1,v2,v3}) generate patterns with O(n^k) complexity due to the comma separator being within the matched character class, causing ambiguous backtracking across k variables. When matched against a maliciously crafted URI, this can result in catastrophic backtracking and uncontrolled resource consumption, leading to denial of service. This vulnerability is fixed in 2.9.0.

NVD

Affected Software

4 affected componentsFixes available
rubygems/addressable>=2.3.0<2.9.0
2.9.0
Microsoft azl3 rubygem-addressable 2.8.5-2
Addressable Project Addressable Ruby>=2.3.0<2.9.0
debian/ruby-addressable<=2.7.0-2, <=2.8.1-1, <=2.8.7-2
2.9.0-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade rubygems/addressable to a version that resolves this vulnerability.

    Fixed in 2.9.0
  2. Upgrade

    Upgrade debian/ruby-addressable to a version that resolves this vulnerability.

    Fixed in 2.9.0-1
  3. Upgrade

    Upgrade addressable to a version that resolves this vulnerability.

    Fixed in 2.9.0
  4. Upgrade

    Upgrade ruby (MRI) to a version that resolves this vulnerability.

    Fixed in 3.2
  5. Configuration

    When matching user-supplied input on unpatched versions of the library, avoid URI template patterns that are vulnerable to catastrophic backtracking: templates using multiple variables with the `+` or `#` operators (e.g., `{+v1,v2}` / `{#v1,v2,v3}`) and templates using the `*` (explode) modifier with any expansion operator (e.g., `{foo*}`, `{+var*}`, `{#var*}`, `{/var*}`, `{.var*}`, `{;var*}`, `{?var*}`, `{&var*}`).

    Addressable URI templates Template pattern usage for user-supplied input = Avoid vulnerable patterns on unpatched Addressable versions
  6. Compensating control

    Apply a short timeout around any call to `Template#match` or `Template#extract` that processes user-supplied data.

Event History

Apr 7, 2026
CVE Published
via MITRE·04:38 PM
Data Sourced
via MITRE·04:38 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:16 PM
DescriptionSeverityWeaknessAffected Software
Apr 8, 2026
Advisory Published
via GitHub·12:05 AM
Data Sourced
via GitHub·12:05 AM
DescriptionSeverityWeaknessAffected Software
Apr 11, 2026
Data Sourced
via Microsoft·08:01 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·08:01 AM
Affected Software
Updated
via Microsoft·08:01 AM
DescriptionSeverity
Jul 7, 2026
Data Sourced
via Debian·05:38 PM
DescriptionAffected Software
Data Sourced
via Launchpad·05:38 PM
Description
Jul 8, 2026
Data Sourced
via Ubuntu·05:38 PM
RemedyDescriptionSeverityAffected Software

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203