Bug 1961382 (CVE-2021-22902) - CVE-2021-22902 rails: Possible Denial of Service vulnerability in Action Dispatch
Summary: CVE-2021-22902 rails: Possible Denial of Service vulnerability in Action Disp...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2021-22902
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1961383 1961738
Blocks: 1961384
TreeView+ depends on / blocked
 
Reported: 2021-05-17 19:20 UTC by Pedro Sampaio
Modified: 2022-12-16 08:36 UTC (History)
31 users (show)

Fixed In Version: actionpack-6.0.3.7, actionpack-6.1.0.2
Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in RubyGem Actionpack which is framework for handling and responding to web requests in Rails. A possible Denial of Service vulnerability was found in the Mime type parser of Action Dispatch.
Clone Of:
Environment:
Last Closed: 2021-11-13 15:49:21 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:08:14 UTC

Description Pedro Sampaio 2021-05-17 19:20:28 UTC
There is a possible Denial of Service vulnerability in the Mime type parser
of
Action Dispatch. This vulnerability has been assigned the CVE identifier
CVE-2021-22902.

Versions Affected:  >= 6.0.0
Not affected:       < 6.0.0
Fixed Versions:     6.0.3.7, 6.1.0.2

Impact
------
There is a possible Denial of Service vulnerability in Action Dispatch.
Carefully crafted Accept headers can cause the mime type parser in Action
Dispatch to do catastrophic backtracking in the regular expression engine.

Releases
--------
The fixed releases are available at the normal locations.

Workarounds
-----------
The following monkey patch placed in an initializer can be used to work
around
the issue:

```ruby
module Mime
  class Type
    MIME_REGEXP =
/\A(?:\*\/\*|#{MIME_NAME}\/(?:\*|#{MIME_NAME})(?>\s*#{MIME_PARAMETER}\s*)*)\z/
  end
end
```

Patches
-------
To aid users who aren't able to upgrade immediately we have provided
patches for
the two supported release series. They are in git-am format and consist of a
single changeset.

* 6-0-Prevent-catastrophic-backtracking-during-mime-parsin.patch - Patch
for 6.0 series
* 6-1-Prevent-catastrophic-backtracking-during-mime-parsin.patch - Patch
for 6.1 series

Please note that only the 6.1.Z, 6.0.Z, and 5.2.Z series are supported at
present. Users of earlier unsupported releases are advised to upgrade as
soon
as possible as we cannot guarantee the continued availability of security
fixes for unsupported releases.

Credits
-------

Thanks to Security Curious <security-curious> for reporting this!

-- 
Aaron Patterson
http://tenderlovemaking.com/

Comment 1 Pedro Sampaio 2021-05-17 19:21:01 UTC
Created rubygem-rails tracking bugs for this issue:

Affects: fedora-all [bug 1961383]

Comment 2 Yadnyawalk Tale 2021-05-18 15:54:49 UTC
Sat 6.8 and 6.9 tracker: https://bugzilla.redhat.com/show_bug.cgi?id=1961738

Comment 4 errata-xmlrpc 2021-11-16 14:08:12 UTC
This issue has been addressed in the following products:

  Red Hat Satellite 6.10 for RHEL 7

Via RHSA-2021:4702 https://access.redhat.com/errata/RHSA-2021:4702


Note You need to log in before you can comment on or make changes to this bug.