All vulnerabilities

RubyGems

CVE-2026-141527

Addressable: Regular Expression Denial of Service in templates with literal text between expressions

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-grhv-8jgq-r74x
Sources
OSV.dev and GitHub

Description

Within the URI template implementation in Addressable, templates with literal text between expressions generate regular expressions vulnerable to excessive backtracking when a variable before the literal text can also match it. Realistic templates are affected:

  • /{year}-{month}-{day}, where each variable can contain -
  • /v{major}.{minor}.{patch}, where each variable can contain .
  • {+base}/{+path}/{+file}, where each variable can contain /
  • {+path}/{name}-{+rest}, where path can contain / and name can contain -

A run of the literal's characters can be divided among k variables in O(n^k) ways. When Template#match or Template#extract is called with a maliciously crafted URI, this can result in uncontrolled resource consumption, leading to denial of service. With 2.9.2, /{year}-{month}-{day} and {+base}/{+path}/{+file} each take about 10 seconds to reject 2 KB of input on MRI Ruby 2.7, and over 15 seconds on JRuby.

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

Workarounds

  • Upgrade to MRI Ruby 3.3 or later, if your application does not use JRuby.
  • 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.
  • 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.
Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

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

About addressable

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

References