🛡️ CVE-2021-41817 — date

🟠 CVSS 8.0 — High ✅ No Known Exploit CWE-1333 OSV
8.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Regular expression denial of service vulnerability (ReDoS) in date

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

```ruby

Date.strptime('2001-02-20', '%Y-%m-%d')

```

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality none, integrity none, availability high.

Weakness class

CVE-2021-41817 is classified as CWE-1333: Inefficient Regular Expression Complexity. A regular expression backtracks catastrophically on crafted input, consuming CPU out of proportion to input size.

Affected software

CVE-2021-41817 is recorded against 3 packages.

  • date (fixed in 2.0.1)
  • ruby
  • ruby-min

Timeline and source

Published on 16 November 2021 and last revised on 27 January 2025. No public exploit is currently recorded for this entry. Record sourced from OSV.

References

nvd.nist.gov (Advisory)
github.com (Web)
hackerone.com (Web)
github.com (Package)
github.com (Web)
lists.fedoraproject.org (Web)
lists.fedoraproject.org (Web)
lists.fedoraproject.org (Web)
lists.fedoraproject.org (Web)
security.gentoo.org (Web)
www.ruby-lang.org (Web)

CVE-2021-41817 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity HIGH
CVSS Score 8.0
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CWE CWE-1333
Public Exploit ✅ No
Source OSV
Published 2021-11-16
Updated 2026-08-12
Modified 2025-01-27
Fix URL N/A

Affected Packages

Software From version Fixed in
date 2.0.1
ruby
ruby-min

References

Similar Threats

Site Security Check

Is date part of your stack?

CVE-2021-41817 is rated CVSS 8.0 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.