7.5high
Regular expression denial of service vulnerability (ReDoS) in date
- Severity
- 7.5high CVSS:3.1 by NVD
- Exploit likelihood
- 3.46% (higher than 89% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-qg54-694p-wgppBIT-RUBY-2021-41817BIT-RUBY-MIN-2021-41817
Description
Date.parse in the date gem through 3.2.0 for Ruby allows ReDoS (regular expression Denial of Service) via a long string. The fixed versions are 3.2.1, 3.1.2, 3.0.2, and 2.0.1.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| date (RubyGems) | from 3.2.0 before 3.2.1, from 3.1.0 before 3.1.2, from 3.0.0 before 3.0.2, before 2.0.1 | GitHub Advisory Database |
| ruby-lang date | before 2.0.1, from 3.0.0 before 3.0.2, from 3.1.0 before 3.1.2, 3.2.0 | NVD |
| ruby-lang ruby | from 2.6.0 before 2.6.9, from 2.7.0 before 2.7.5, from 3.0.0 before 3.0.3 | NVD |
| redhat software_collections | Not specified | NVD |
| redhat enterprise_linux | 7.0, 8.0 | NVD |
| fedoraproject fedora | 34, 35 | NVD |
| debian debian_linux | 9.0, 10.0, 11.0 | NVD |
| suse linux_enterprise | 12.0, 15.0 | NVD |
| opensuse factory | Not specified | NVD |
| opensuse leap | 15.2 | NVD |
| ruby (Bitnami) | from 2.6.0 before 2.6.9, from 2.7.0 before 2.7.5, from 3.0.0 before 3.0.3 | Bitnami Vulnerability Database |
| ruby-min (Bitnami) | from 2.6.0 before 2.6.9, from 2.7.0 before 2.7.5, from 3.0.0 before 3.0.3 | Bitnami Vulnerability Database |
All scores
| 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 |
| Bitnami Vulnerability Database | high rating |
Classification
What each source says
CVE List
Date.parse in the date gem through 3.2.0 for Ruby allows ReDoS (regular expression Denial of Service) via a long string. The fixed versions are 3.2.1, 3.1.2, 3.0.2, and 2.0.1.
GitHub Advisory Database
Date’s parsing methods including Date.parse are using Regexps internally, some of which are vulnerable against regular expression denial of service. Applications and libraries that apply such methods to untrusted input may be affected.
The fix limits the input length up to 128 bytes by default instead of changing the regexps. This is because Date gem uses many Regexps and it is possible that there are still undiscovered vulnerable Regexps. For compatibility, it is allowed to remove the limitation by explicitly passing limit keywords as nil like Date.parse(str, limit: nil), but note that it may take a long time to parse.
Please update the date gem to version 3.2.1, 3.1.2, 3.0.2, and 2.0.1, or later. You can use gem update date to update it. If you are using bundler, please add gem "date", ">= 3.2.1" to your Gemfile. If you import date from the standard library rather than as a gem you should update your Ruby install to 3.0.3, 2.7.5, 2.6.9 or later.
Users unable to upgrade may consider using Date.strptime instead with a predefined date format
Date.strptime('2001-02-20', '%Y-%m-%d')
NVD (es)
Date.parse en date gem versiones hasta 3.2.0 para Ruby, permite ReDoS (expresión regular de denegación de servicio) por medio de una cadena larga. Las versiones corregidas son 3.2.1, 3.1.2, 3.0.2 y 2.0.1.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-41817 changed 2024-08-04 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-qg54-694p-wgpp changed 2025-01-27 | CC-BY-4.0 |
| NVD | CVE-2021-41817 changed 2026-06-17 | Public domain |
| Bitnami Vulnerability Database | BIT-RUBY-2021-41817 changed 2026-09-08 | Apache-2.0 |
| Bitnami Vulnerability Database | BIT-RUBY-MIN-2021-41817 changed 2026-09-08 | Apache-2.0 |