Loading...
Skip to main content

CVE-2021-41817 — Vulnerability in date — CVE Details

HIGH

Regular expression denial of service vulnerability (ReDoS) in date

Published November 16, 2021Updated January 27, 2025Source: osv

Summary

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') ```

Advisory Timeline

  • First published November 16, 2021 (1791 days ago).
  • Last revised January 27, 2025 — 1168 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Bundler
Update date to 2.0.1 or later
gem install date -v 2.0.1
Bundler
Update date to 3.0.2 or later
gem install date -v 3.0.2
Bundler
Update date to 3.1.2 or later
gem install date -v 3.1.2
Bundler
Update date to 3.2.1 or later
gem install date -v 3.2.1

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (4)

Affects 1 ecosystem: rubygems (1).

PackageEcosystemAffectedFixed In
date
rubygems
0.0.1, 1.0.0, 2.0.02.0.1
date
rubygems
3.0.0, 3.0.13.0.2
date
rubygems
3.1.0, 3.1.13.1.2
date
rubygems
3.2.03.2.1

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Frequently Asked Questions

What is CVE-2021-41817?
Regular expression denial of service vulnerability (ReDoS) in date This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
How do I check if my project is affected by CVE-2021-41817?
CVE-2021-41817 affects date. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2021-41817 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.5

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

GHSA-qg54-694p-wgpp
BIT-ruby-2021-41817
BIT-ruby-min-2021-41817

Related CVEs

  • CVE-2026-94462
    HIGH

    Spree: Broken Access Control in `PATCH /api/v3/store/carts/:id/associate` (IDOR)

  • CVE-2026-77601
    HIGH

    OpenC3 COSMOS: Authenticated OS command injection via the `pypi_url` setting

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies