Lucene search

K
rubygemsRubySecRUBY:DATE-2021-41817
HistoryNov 14, 2021 - 9:00 p.m.

Regular Expression Denial of Service Vulnerability of Date Parsing Methods

2021-11-1421:00:00
RubySec
rubysec.com
10
date parsing
regex denial
input limitation
date gem
update
bundler.

CVSS2

5

Attack Vector

NETWORK

Attack Complexity

LOW

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

NONE

Availability Impact

PARTIAL

AV:N/AC:L/Au:N/C:N/I:N/A:P

CVSS3

7.5

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

NONE

Integrity Impact

NONE

Availability Impact

HIGH

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

EPSS

0.005

Percentile

77.4%

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.

Affected configurations

Vulners
Node
rubydateRange2.0.02.1.0
OR
rubydateRange3.0.13.1.0
OR
rubydateRange3.1.13.2.0
OR
rubydateRange<3.2.1
VendorProductVersionCPE
rubydate*cpe:2.3:a:ruby:date:*:*:*:*:*:*:*:*

CVSS2

5

Attack Vector

NETWORK

Attack Complexity

LOW

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

NONE

Availability Impact

PARTIAL

AV:N/AC:L/Au:N/C:N/I:N/A:P

CVSS3

7.5

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

NONE

Integrity Impact

NONE

Availability Impact

HIGH

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

EPSS

0.005

Percentile

77.4%