7.5high
Regular Expression Denial of Service in Addressable templates
- Severity
- 7.5high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 2.14% (higher than 83% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-jxhc-q857-3j6g
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
| Product or package | Versions | Reported by |
|---|---|---|
| sporkmonger addressable | > 2.3.0, <= 2.7.0 | CVE List |
| addressable (RubyGems) | from 2.3.0 before 2.8.0 | GitHub Advisory Database |
| addressable_project addressable | from 2.3.0 before 2.8.0 | NVD |
| fedoraproject fedora | 33, 34 | NVD |
All scores
| GitHub_M | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 5.0medium CVSS:2.0 | AV:N/AC:L/Au:N/C:N/I:N/A:P |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
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:
NVD (es)
Addressable es una implementación alternativa a la implementación URI que forma parte de la biblioteca estándar de Ruby. Se presenta una vulnerabilidad de consumo de recursos no controlados después de la versión 2.3.0 hasta la versión 2.7.0. Dentro de la implementación de plantillas URI en Addressable, una plantilla diseñada maliciosamente puede resultar en un consumo no controlado de recursos, conllevando a una denegación de servicio cuando se compara con una URI. En el uso típico, las plantillas no se leerían normalmente de la entrada de un usuario no fiable, pero sin embargo, ningún aviso de seguridad anterior para Addressable ha sido advertido en contra esto. Unos usuarios de las capacidades de análisis de Addressable, pero no de las capacidades de plantillas URI, no están afectados. La vulnerabilidad está parcheada en la versión 2.8.0. Como solución, sólo cree objetos de Plantilla desde fuentes confiables que hayan sido comprobadas para no producir retrocesos catastróficos
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-32740 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-jxhc-q857-3j6g changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-32740 changed 2026-06-17 | Public domain |