All vulnerabilities

RubyGems

CVE-2026-141525

Addressable: Regular Expression Denial of Service in Addressable templates on MRI Ruby 3.2 and TruffleRuby

Severity
Medium 5.9
Published
1 Dec 2026
Last changed
1 Dec 2026
Added to UpHeron
1 Dec 2026
Fixed in
2.10.0
Weakness
Regular expression denial of service (ReDoS) (CWE-1333)
Attack
Over the network · Only under certain conditions · No login needed · No user action needed
Attacker can
Take it down
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Also known as
GHSA-jrfq-gw62-2f3j
Sources
OSV.dev and GitHub

Description

Addressable 2.9.1 changed the regular expressions generated for URI templates to fix GHSA-9f42-57jx-vpp3 and GHSA-4w5q-wg7v-w6gp. The new regular expressions contain lookaround assertions for some expressions, such as {a}{b}, {a,b}, {/a,b}, {?a*,b} and expressions with an exploded variable followed by unexploded ones. MRI Ruby 3.2 doesn't memoize a regular expression that contains a lookaround, and memoization is decided for the whole template's regular expression, so one such expression makes the rest of the template backtrack as on older Rubies. TruffleRuby 40.0 also backtracks for some of these regular expressions.

As a result, templates that 2.9.0 matched in linear time on these runtimes are polynomial since 2.9.1. On MRI Ruby 3.2, this includes templates that combine a common shape with one of those expressions, such as /{year}-{month}-{day}/{a}{b}.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Workarounds

  • Upgrade to MRI Ruby 3.3 or later.
  • Limit the length of user-supplied URIs before matching them. Because the cost is polynomial, this only bounds it, but it works on every runtime, including TruffleRuby, where a timeout doesn't.
  • On MRI Ruby 3.2, apply a short timeout, such as Timeout.timeout, around any call to Template#match or Template#extract that processes user-supplied data. It interrupts the matching thread at an arbitrary point, so it isn't safe in every application. On TruffleRuby, it doesn't stop a regular expression match.
Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
addressableRubyGems · osv:RubyGems:addressable
  • From 2.9.1 before 2.10.0

About addressable

Total downloads (RubyGems)
1,323,514,580RubyGems, 1 Dec 2026

References