CVE-2026-141529: Addressable :Template Builds Its Regexp Vulnerability

LOW
Advisory Identifier: GHSA-h78h-gj97-g737
CVSS 3.7
CWE-407
Published
Advisory Summary

CVE-2026-141529 is a LOW (CVSS 3.7) :template builds its regexp vulnerability (CWE-407: Inefficient Algorithmic Complexity) affecting Addressable libraries in the RubyGems ecosystem. The issue involves :template builds its regexp in quadratic time for patterns with non-ascii characters or many adjacent expressions. Remediation is available by upgrading affected packages to version 2.10.0.

CVE-2026-141529 at a Glance

CVE Identifier CVE-2026-141529
GHSA Identifier GHSA-h78h-gj97-g737
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-407: Inefficient Algorithmic Complexity
Affected Product Addressable
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 3.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2026-141529

To remediate this vulnerability, upgrade all affected Addressable dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

addressable fixed: 2.10.0
Upgrade addressable to 2.10.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for addressable

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-141529, inspect your project dependencies for Addressable:

inspect dependencies for addressable

Analyze the terminal output to locate any version of Addressable in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.10.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-407: Inefficient Algorithmic Complexity, where an algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached. In Addressable, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact `Addressable::Template` builds a regular expression from its pattern the first time it's needed, by `#match`, `#extract`, `#to_regexp`, `#variables` (and its aliases `#keys` and `#names`), `#variable_defaults` or `#freeze`. When the pattern has non-ASCII characters, or a long run of expressions with no literal text between them (such as `{a}{b}{c}`), building it takes time quadratic in the pattern's length. A non-ASCII pattern of a few hundred kilobytes takes seconds on MRI and longer on JRuby. A run of 5,000 expressions, 15 KB, takes about 4 seconds on MRI and 8 seconds on JRuby. Other templates build in linear time. The cost is in the pattern, not in the URI being matched, so only an application that builds templates from untrusted input is affected. Matching untrusted URIs against the application's own templates isn't. The regular expression is cached on the template, so the cost is paid once per template, except that `#match` and `#extract` with a processor build it on every call. `#expand` and `#partial_expand` don't build it and aren't affected. Templates from untrusted sources are uncommon, and the attacker needs a pattern of many kilobytes to cause a delay of seconds, so attack complexity is high. ### Affected Versions This vulnerability affects Addressable >= 2.9.1. Version 2.9.1 added a step that looks at what follows each expression. It finds each expression's position by character offset, and for each expression it looks through every later expression with no literal text before it, so either kind of pattern makes building the regular expression quadratic. It is fixed in 2.10.0, where the step works in byte offsets and in a single pass. ### Workarounds - Don't match, extract, list the variables of or freeze templates from untrusted sources, or limit their length. - Reject templates with non-ASCII characters, or pct-encode those characters before building the template, and reject templates with long runs of expressions next to each other. ### Proof of Concept ```ruby require "addressable/template" [10_000, 20_000].each do |count| template = Addressable::Template.new("é{a}" * count) started = Process.clock_gettime(Process::CLOCK_MONOTONIC) template.to_regexp elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - started puts "%6d expressions: %.2fs" % [count, elapsed] end ``` On affected versions, doubling the number of expressions roughly triples to quadruples the time. On fixed versions, and with `a` in place of `é` on any version, it roughly doubles. The same holds for expressions next to each other, at smaller sizes: ```ruby require "addressable/template" [2_500, 5_000].each do |count| template = Addressable::Template.new("{a}" * count) started = Process.clock_gettime(Process::CLOCK_MONOTONIC) template.to_regexp elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - started puts "%6d expressions: %.2fs" % [count, elapsed] end ``` On affected versions, doubling the number of expressions quadruples the time. On fixed versions, and with `a{a}` in place of `{a}` on any version, it roughly doubles. ### Credits Found by Bob Aman (@sporkmonger). ### For more information If ther are any questions or comments about this advisory: * [Open an issue](https://github.com/sporkmonger/addressable/issues)

CVE-2026-141529 Affected Addressable Versions

1 component(s)
Fixed Versions:
2.10.0
Product / Package Ecosystem Affected Versions Fixed Version
addressable
RubyGems
≥ 2.9.1
< 2.10.0
2.10.0

References

Frequently Asked Questions

What is CVE-2026-141529?
CVE-2026-141529 is a security vulnerability in Addressable involving :Template builds its regexp in quadratic time for patterns with non-ASCII characters or many adjacent expressions under CWE-407: Inefficient Algorithmic Complexity.
Which Addressable versions are affected?
Affected versions include releases prior to 2.10.0 across affected packages: addressable.
What version fixes CVE-2026-141529?
Upgrading to 2.10.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is addressable affected?
Yes, addressable is affected in releases prior to 2.10.0. Upgrade your dependency to 2.10.0 or later.
What is the CVSS score of CVE-2026-141529?
CVE-2026-141529 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2026-141529?
CVE-2026-141529 is classified under CWE-407: Inefficient Algorithmic Complexity (An algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached.).
How can I check RubyGems dependencies for CVE-2026-141529?
Run the dependency tree command: 'inspect dependencies for addressable'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-h78h-gj97-g737",
  "modified" : "2026-12-01T23:48:42Z",
  "published" : "2026-12-01T23:48:42Z",
  "aliases" : [ "CVE-2026-141529" ],
  "summary" : "Addressable::Template builds its regexp in quadratic time for patterns with non-ASCII characters or many adjacent expressions",
  "details" : "### Impact\n\n`Addressable::Template` builds a regular expression from its pattern the first time it's needed, by `#match`, `#extract`, `#to_regexp`, `#variables` (and its aliases `#keys` and `#names`), `#variable_defaults` or `#freeze`. When the pattern has non-ASCII characters, or a long run of expressions with no literal text between them (such as `{a}{b}{c}`), building it takes time quadratic in the pattern's length. A non-ASCII pattern of a few hundred kilobytes takes seconds on MRI and longer on JRuby. A run of 5,000 expressions, 15 KB, takes about 4 seconds on MRI and 8 seconds on JRuby. Other templates build in linear time.\n\nThe cost is in the pattern, not in the URI being matched, so only an application that builds templates from untrusted input is affected. Matching untrusted URIs against the application's own templates isn't. The regular expression is cached on the template, so the cost is paid once per template, except that `#match` and `#extract` with a processor build it on every call. `#expand` and `#partial_expand` don't build it and aren't affected.\n\nTemplates from untrusted sources are uncommon, and the attacker needs a pattern of many kilobytes to cause a delay of seconds, so attack complexity is high.\n\n### Affected Versions\n\nThis vulnerability affects Addressable >= 2.9.1. Version 2.9.1 added a step that looks at what follows each expression. It finds each expression's position by character offset, and for each expression it looks through every later expression with no literal text before it, so either kind of pattern makes building the regular expression quadratic. It is fixed in 2.10.0, where the step works in byte offsets and in a single pass.\n\n### Workarounds\n\n- Don't match, extract, list the variables of or freeze templates from untrusted sources, or limit their length.\n- Reject templates with non-ASCII characters, or pct-encode those characters before building the template, and reject templates with long runs of expressions next to each other.\n\n### Proof of Concept\n\n```ruby\nrequire \"addressable/template\"\n\n[10_000, 20_000].each do |count|\n  template = Addressable::Template.new(\"é{a}\" * count)\n  started = Process.clock_gettime(Process::CLOCK_MONOTONIC)\n  template.to_regexp\n  elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - started\n  puts \"%6d expressions: %.2fs\" % [count, elapsed]\nend\n```\n\nOn affected versions, doubling the number of expressions roughly triples to quadruples the time. On fixed versions, and with `a` in place of `é` on any version, it roughly doubles.\n\nThe same holds for expressions next to each other, at smaller sizes:\n\n```ruby\nrequire \"addressable/template\"\n\n[2_500, 5_000].each do |count|\n  template = Addressable::Template.new(\"{a}\" * count)\n  started = Process.clock_gettime(Process::CLOCK_MONOTONIC)\n  template.to_regexp\n  elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - started\n  puts \"%6d expressions: %.2fs\" % [count, elapsed]\nend\n```\n\nOn affected versions, doubling the number of expressions quadruples the time. On fixed versions, and with `a{a}` in place of `{a}` on any version, it roughly doubles.\n\n### Credits\n\nFound by Bob Aman (@sporkmonger).\n\n### For more information\n\nIf ther are any questions or comments about this advisory:\n* [Open an issue](https://github.com/sporkmonger/addressable/issues)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "addressable"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.9.1"
      }, {
        "fixed" : "2.10.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.9.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/sporkmonger/addressable/security/advisories/GHSA-h78h-gj97-g737"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-141529"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sporkmonger/addressable/commit/ebe911f8623bcc664d2e6df079c96c325ad181c8"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sporkmonger/addressable"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sporkmonger/addressable/releases/tag/addressable-2.10.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-407" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-01T23:48:42Z",
    "nvd_published_at" : "2026-12-01T21:17:12Z"
  }
}