CVE-2021-32740Regular Expression Denial of Service in Addressable templates
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.
What to do
Fixed builds are available from Alpine, Debian, RubyGems: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 25.10 | ruby-addressable | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | ruby-addressable | Fix pending | UBUNTU-CVE-2021-32740 | |
| Ubuntu 18.04 | ruby-addressable | Fix pending | UBUNTU-CVE-2021-32740 | |
| Ubuntu 16.04 | ruby-addressable | Fix pending | UBUNTU-CVE-2021-32740 | |
| Ubuntu 14.04 | ruby-addressable | Fix pending | ||
| Debian 14 | ruby-addressable | Fixed | 2.7.0-2 | DEBIAN-CVE-2021-32740 |
| Debian 13 | ruby-addressable | Fixed | 2.7.0-2 | DEBIAN-CVE-2021-32740 |
| Debian 12 | ruby-addressable | Fixed | 2.7.0-2 | DEBIAN-CVE-2021-32740 |
| Alpine Linux 3.24 | ruby-addressable | Fixed | 2.8.0-r0 | ALPINE-CVE-2021-32740 |
| Alpine Linux 3.23 | ruby-addressable | Fixed | 2.8.0-r0 | ALPINE-CVE-2021-32740 |
| Alpine Linux 3.22 | ruby-addressable | Fixed | 2.8.0-r0 | ALPINE-CVE-2021-32740 |
| Alpine Linux 3.21 | ruby-addressable | Fixed | 2.8.0-r0 | ALPINE-CVE-2021-32740 |
| Alpine Linux 3.20 | ruby-addressable | Fixed | 2.8.0-r0 | ALPINE-CVE-2021-32740 |
| Alpine Linux 3.19 | ruby-addressable | Fixed | 2.8.0-r0 | ALPINE-CVE-2021-32740 |
| Alpine Linux 3.18 | ruby-addressable | Fixed | 2.8.0-r0 | ALPINE-CVE-2021-32740 |
| Alpine Linux 3.17 | ruby-addressable | Fixed | 2.8.0-r0 | ALPINE-CVE-2021-32740 |
| Alpine Linux 3.16 | ruby-addressable | Fixed | 2.8.0-r0 | ALPINE-CVE-2021-32740 |
| Alpine Linux 3.15 | ruby-addressable | Fixed | 2.8.0-r0 | ALPINE-CVE-2021-32740 |
| RubyGems library | addressable | Fixed | 2.8.0 | GHSA-jxhc-q857-3j6g |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- sporkmonger addressable: affected: > 2.3.0, <= 2.7.0
Vendor advisories:
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/… (vendor-advisory)
References
- https://github.com/sporkmonger/addressable/security/advisories/GHSA-jxhc-q857-3j6g
- https://github.com/sporkmonger/addressable/commit/0d8a3127e35886ce9284810a7f2438bff6b43cbc
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WYPVOOQU7UB277UUERJMCNQLRCXRCIQ5/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SDFQM2NHNAZ3NNUQZEJTYECYZYXV4UDS/
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.