CVE-2021-32740 — Regular Expression Denial of Service in addressable
Regular Expression Denial of Service in Addressable templates
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.
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
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
- https://cwe.mitre.org/data/definitions/1333.html
- https://www.regular-expressions.info/catastrophic.html
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.
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).
| Package | Fixed 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.
- CWE-1333
- CWE-400Uncontrolled Resource ConsumptionMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
References
- https://github.com/sporkmonger/addressable/security/advisories/GHSA-jxhc-q857-3j6gWEB
- https://nvd.nist.gov/vuln/detail/CVE-2021-32740ADVISORY
- https://github.com/sporkmonger/addressable/commit/0d8a3127e35886ce9284810a7f2438bff6b43cbcWEB
- https://github.com/sporkmonger/addressable/commit/89c76130ce255c601f642a018cb5fb5a80e679a7WEB
- https://github.com/sporkmonger/addressable/commit/92685096b1f7235ed8986c03ce30a24972eed848#diff-fb36d3dc67e6565ffde17e666a98697f48e76dac38fabf1bb9e97cdf3b583d76WEB
- https://github.com/advisories/GHSA-jxhc-q857-3j6gADVISORY
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/addressable/CVE-2021-32740.ymlWEB
- https://github.com/sporkmonger/addressablePACKAGE
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SDFQM2NHNAZ3NNUQZEJTYECYZYXV4UDSWEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/WYPVOOQU7UB277UUERJMCNQLRCXRCIQ5WEB
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
Significant impact if exploited, or exploitable with modest effort.
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
Related CVEs
- CVE-2026-126366HIGH
msgpack-ruby JRuby decoder makes uncapped header-count allocations; a 5-byte message forces multi-GiB OOM
- CVE-2026-35611HIGH
Addressable has a Regular Expression Denial of Service in Addressable templates
- CVE-2026-126081HIGH
Action Pack: Possible Strong Parameters Bypass in Parameters#each_key
- CVE-2026-126354MEDIUM
Addressable URI normalization resolves some dotted path segments to the wrong path
- CVE-2026-126352MEDIUM
Addressable: Regular Expression Denial of Service in templates with multiple variables
- CVE-2026-126350MEDIUM
Addressable: Regular Expression Denial of Service in templates with certain exploded expressions
- CVE-2026-126351MEDIUM
Addressable: Denial of service in URI path normalization