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
- 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}.
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.
Affected software
| Software | Affected versions |
|---|---|
addressableRubyGems · osv:RubyGems:addressable |
|
About addressable
- Total downloads (RubyGems)
- 1,323,514,580RubyGems, 1 Dec 2026
Vulnerabilities in addressable
- In our list
- 20
- Published in the last 12 months
- 20
- Critical, last 12 months
- 0
- High, last 12 months
- 0
- Known exploited
- 0
- CVE-2026-141532Addressable URI#origin= takes the host from the userinfoLow 3.7 2 Dec 2026
- CVE-2026-141536Addressable URI#request_uri returns control characters unencoded with possible HTTP request splittingLow 3.7 1 Dec 2026
- CVE-2026-141535Addressable URI#hostname strips brackets from hosts that aren't IP literalsLow 3.7 1 Dec 2026
- CVE-2026-141537Addressable URI normalization takes quadratic time on long runs of combining marksLow 3.7 1 Dec 2026
- CVE-2026-141538Addressable URI userinfo setters store delimiters raw, so the serialized URI names a different hostMedium 4.8 1 Dec 2026
- CVE-2026-141539Addressable native IDNA backend truncates a host at a pct-encoded NUL when normalizingMedium 4.8 1 Dec 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-141525
- GitHub Advisory Database https://github.com/advisories/GHSA-jrfq-gw62-2f3j