CVE-2021-32740
Regular Expression Denial of Service in Addressable templates
Reported by github_m · Published July 6, 2021
addressable is fixed in 2.8.0 (RubyGems)
Addressable is an alternative implementation to the URI implementation that is part of Ruby's standard library. An uncontrolled resource consumption vulnerability exists after version 2.3.0 through version 2.7.0. 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. The vulnerability is patched in version 2.8.0. As a workaround, only create Template objects from trusted sources that have been validated not to produce catastrophic backtracking.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| addressable | RubyGems | 2.8.0 |
| ruby-addressable | Alpine | 2.8.0-r0 |
| ruby-addressable | Arch Linux | 2.8.0-1 |
| addressable | addressable_project | 2.8.0 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| sporkmonger | addressable | > 2.3.0, <= 2.7.0 |
| alpine | ruby-addressable | 0 |
| RubyGems | addressable | 2.3.0 |
| arch | ruby-addressable | 0 |
| sporkmonger | addressable | > 2.3.0, <= 2.7.0 |
Timeline
- Jul 6, 2021 CVE Published
- Jul 6, 2021 PoC Published (8 in total, the first dated here)
- Jul 7, 2021 EPSS Score (30 in total, the first dated here)
- Apr 6, 2026 CVE Updated
- Jun 1, 2026 Security Advisory (2 in total, the first dated here)
- Aug 1, 2026 Coalition ESS Score
- Oct 13, 2026 Distribution Patch
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2021-32740
vulnetix vdb fixes CVE-2021-32740
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2021-32740/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- x_refsource_CONFIRM
- x_refsource_MISC
- FEDORA-2021-5d14763df8 vendor-advisoryx_refsource_FEDORA
- FEDORA-2021-e9fc035565 vendor-advisoryx_refsource_FEDORA
- https://nvd.nist.gov/vuln/detail/CVE-2021-32740 advisory
- https://github.com/advisories/GHSA-jxhc-q857-3j6g advisory
- https://github.com/sporkmonger/addressable/commit/89c76130ce255c601f642a018cb5fb5a80e679a7 patch
- https://github.com/sporkmonger/addressable/commit/92685096b1f7235ed8986c03ce30a24972eed848#diff-fb36d3dc67e6565ffde17e666a98697f48e76dac38fabf1bb9e97cdf3b583d76 patch
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/addressable/CVE-2021-32740.yml advisory
- https://github.com/sporkmonger/addressable url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/SDFQM2NHNAZ3NNUQZEJTYECYZYXV4UDS url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/WYPVOOQU7UB277UUERJMCNQLRCXRCIQ5 url