Skip to main content

CVE-2021-32740 — Regular Expression Denial of Service in addressable

HIGH

Regular Expression Denial of Service in Addressable templates

Published July 12, 2021Updated July 8, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (2.14%). Schedule for your next planned update.

Does your project use an affected addressable version?

Paste your Gemfile.lock to check it for CVE-2021-32740 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my Gemfile.lock

Summary

Impact

Within the URI template implementation in Addressable, a maliciously crafted template may result in uncontrolled resource consumption, leading to denial of service when matched against a URI. In typical usage, templates would not normally be read from untrusted user input, but nonetheless, no previous security advisory for Addressable has cautioned against doing this. Users of the parsing capabilities in Addressable but not the URI template capabilities are unaffected.

Patches

The vulnerability was introduced in version 2.3.0 (previously yanked) and has been present in all subsequent versions up to, and including, 2.7.0. It is fixed in version 2.8.0.

Workarounds

The vulnerability can be avoided by only creating Template objects from trusted sources that have been validated not to produce catastrophic backtracking.

References

For more information

If you have any questions or comments about this advisory:

Advisory Timeline

  • First published July 12, 2021 (1964 days ago).
  • Last revised July 8, 2026 — 1822 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Bundler
Update addressable to 2.8.0 or later
gem install addressable -v 2.8.0

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: RubyGems (1).

PackageFixed In
addressable RubyGems · Affected: 2.3.2, 2.3.3, 2.3.4, 2.3.5 (+9 more)2.8.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Frequently Asked Questions

What is CVE-2021-32740?
Regular Expression Denial of Service in Addressable templates. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
How do I check if my project is affected by CVE-2021-32740?
CVE-2021-32740 affects addressable. It has a 2.1% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2021-32740 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.5

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
2.14%
EPSS percentile: 82.7

This places it in the top quartile of EPSS-scored vulnerabilities — 82.7% of tracked vulnerabilities score at or below it, so it is more likely to be exploited than most of the tracked corpus.

Also Known As

GHSA-jxhc-q857-3j6g

Related CVEs

  • CVE-2026-126366
    HIGH

    msgpack-ruby JRuby decoder makes uncapped header-count allocations; a 5-byte message forces multi-GiB OOM

  • CVE-2026-35611
    HIGH

    Addressable has a Regular Expression Denial of Service in Addressable templates

  • CVE-2026-126081
    HIGH

    Action Pack: Possible Strong Parameters Bypass in Parameters#each_key

  • CVE-2026-126354
    MEDIUM

    Addressable URI normalization resolves some dotted path segments to the wrong path

  • CVE-2026-126352
    MEDIUM

    Addressable: Regular Expression Denial of Service in templates with multiple variables

  • CVE-2026-126350
    MEDIUM

    Addressable: Regular Expression Denial of Service in templates with certain exploded expressions

  • CVE-2026-126351
    MEDIUM

    Addressable: Denial of service in URI path normalization

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Gemfile.lock