Bug 1561950 (CVE-2018-8777) - CVE-2018-8777 ruby: DoS by large request in WEBrick
Summary: CVE-2018-8777 ruby: DoS by large request in WEBrick
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2018-8777
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: impact=moderate,public=20180328,repor...
Depends On: 1561956 1561957 1561958 1563873 1563874 1565258 1568428 1568429 1568430 1568431 1568432 1651798 1652037 1652038
Blocks: 1561954
TreeView+ depends on / blocked
 
Reported: 2018-03-29 09:08 UTC by Adam Mariš
Modified: 2019-08-06 12:03 UTC (History)
30 users (show)

Fixed In Version: ruby 2.2.10, ruby 2.3.7, ruby 2.4.4, ruby 2.5.1
Doc Type: If docs needed, set a value
Doc Text:
It was found that WEBrick could be forced to use an excessive amount of memory during the processing of HTTP requests, leading to a Denial of Service. An attacker could use this flaw to send huge requests to a WEBrick application, resulting in the server running out of memory.
Clone Of:
Environment:
Last Closed: 2019-06-10 10:19:09 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:3729 None None None 2018-11-29 09:56:48 UTC
Red Hat Product Errata RHSA-2018:3730 None None None 2018-11-29 10:11:28 UTC
Red Hat Product Errata RHSA-2018:3731 None None None 2018-11-29 10:22:43 UTC
Red Hat Product Errata RHSA-2019:2028 None None None 2019-08-06 12:03:54 UTC

Description Adam Mariš 2018-03-29 09:08:24 UTC
If an attacker sends a large request which contains huge HTTP headers, WEBrick try to process it on memory, so the request causes the out-of-memory DoS attack.

Affected versions:

Ruby 2.2 series: 2.2.9 and earlier
Ruby 2.3 series: 2.3.6 and earlier
Ruby 2.4 series: 2.4.3 and earlier
Ruby 2.5 series: 2.5.0 and earlier

External References:

https://www.ruby-lang.org/en/news/2018/03/28/large-request-dos-in-webrick-cve-2018-8777/

Comment 1 Adam Mariš 2018-03-29 09:14:13 UTC
Created ruby tracking bugs for this issue:

Affects: fedora-all [bug 1561957]

Comment 8 Andrej Nemec 2018-05-14 15:26:26 UTC
Statement:

This issue affects the versions of ruby as shipped with Red Hat CloudForms 4. Red Hat Product Security has rated this issue as having security impact of Moderate. A future update may address this issue. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.

This issue affects the versions of ruby as shipped with Red Hat Subscription Asset Manager 1. Red Hat Product Security has rated this issue as having security impact of Moderate. A future update may address this issue. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.

Comment 9 Jun Aruga 2018-11-15 18:37:13 UTC
Upstream patch:

> Affected versions:

trunk branch: r62965
https://github.com/ruby/ruby/commit/32e277acbf35de454befc1573aff1063a55403cf

> Ruby 2.2 series: 2.2.9 and earlier

ruby_2_2 branch
https://github.com/ruby/ruby/commit/a45622669bb1ff18d3ee9b411128acd839c4263e

> Ruby 2.3 series: 2.3.6 and earlier
> Ruby 2.4 series: 2.4.3 and earlier
> Ruby 2.5 series: 2.5.0 and earlier

On ruby_2_N branches, search by "webrick/httpauth/digestauth: stream req.body" or "r62965".

Notable comment in the commit.

> WARNING! WARNING! WARNING!  LIKELY BROKEN CHANGE
> 
> Pass a proc to WEBrick::HTTPRequest#body to avoid reading a
> potentially large request body into memory during
> authentication.
> 
> WARNING! this will break apps completely which want to do
> something with the body besides calculating the MD5 digest
of it.
> 
> Also, keep in mind that probably nobody uses "auth-int".
> Servers such as Apache, lighttpd, nginx don't seem to
> support it; nor does curl when using POST/PUT bodies;
> and we didn't have tests for it until now...

Comment 10 Jun Aruga 2018-11-16 16:53:28 UTC
> trunk branch: r62965

but ruby_2_2 branch's commit is merged from between r62960 and r62965 with new tests.
https://github.com/ruby/ruby/commit/a45622669bb1ff18d3ee9b411128acd839c4263e
It looks better to merge the commit on ruby_2_2.

Comment 11 Vít Ondruch 2018-11-20 11:47:16 UTC
(In reply to Jun Aruga from comment #9)
> > Also, keep in mind that probably nobody uses "auth-int".
> > Servers such as Apache, lighttpd, nginx don't seem to
> > support it; nor does curl when using POST/PUT bodies;
> > and we didn't have tests for it until now...

I think this ^^ comment explains, that this is probably corner case, which won't affect too many people. Also, upstream applied the patch at the end, even there was this concern, so let's follow.

Comment 14 errata-xmlrpc 2018-11-29 09:56:39 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS

Via RHSA-2018:3729 https://access.redhat.com/errata/RHSA-2018:3729

Comment 15 errata-xmlrpc 2018-11-29 10:11:20 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS

Via RHSA-2018:3730 https://access.redhat.com/errata/RHSA-2018:3730

Comment 16 errata-xmlrpc 2018-11-29 10:22:31 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS

Via RHSA-2018:3731 https://access.redhat.com/errata/RHSA-2018:3731

Comment 17 errata-xmlrpc 2019-08-06 12:03:52 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2019:2028 https://access.redhat.com/errata/RHSA-2019:2028


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