Vulnerability · Published Jul 6, 2021 · Assigned by GitHub_M
CVE-2021-32740Regular Expression Denial of Service in Addressable templates
High 7.5
In plain English
A high-severity uncontrolled resource consumption in addressable from sporkmonger. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 2.1% (higher than 82% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.20 | ruby-addressable | 2.8.0-r0 | ALPINE-CVE-2021-32740 |
| Alpine:v3.21 | ruby-addressable | 2.8.0-r0 | ALPINE-CVE-2021-32740 |
| Alpine:v3.22 | ruby-addressable | 2.8.0-r0 | ALPINE-CVE-2021-32740 |
| Alpine:v3.23 | ruby-addressable | 2.8.0-r0 | ALPINE-CVE-2021-32740 |
| Alpine:v3.24 | ruby-addressable | 2.8.0-r0 | ALPINE-CVE-2021-32740 |
| Debian:12 | ruby-addressable | 2.7.0-2 | DEBIAN-CVE-2021-32740 |
| Debian:13 | ruby-addressable | 2.7.0-2 | DEBIAN-CVE-2021-32740 |
| Debian:14 | ruby-addressable | 2.7.0-2 | DEBIAN-CVE-2021-32740 |
| RubyGems | addressable | 2.8.0 | GHSA-jxhc-q857-3j6g |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| sporkmonger | addressable | > 2.3.0, <= 2.7.0 |
Weakness: CWE-400 · Vector: 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-3j6g x_refsource_CONFIRM
- https://github.com/sporkmonger/addressable/commit/0d8a3127e35886ce9284810a7f2438bff6b43cbc x_refsource_MISC
- FEDORA-2021-5d14763df8 vendor-advisory, x_refsource_FEDORA
- FEDORA-2021-e9fc035565 vendor-advisory, x_refsource_FEDORA