Bug 770820 (CVE-2011-4838) - CVE-2011-4838 jruby: hash table collisions DoS (oCERT-2011-003)
Summary: CVE-2011-4838 jruby: hash table collisions DoS (oCERT-2011-003)
Alias: CVE-2011-4838
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 770821 771530 771536
Blocks: 770822 hashdos, oCERT-2011-003
TreeView+ depends on / blocked
Reported: 2011-12-29 10:44 UTC by Huzaifa S. Sidhpurwala
Modified: 2023-05-12 22:41 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2021-10-19 21:50:20 UTC

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:1125 0 normal SHIPPED_LIVE Important: JBoss Enterprise SOA Platform 5.3.0 update 2012-07-31 18:32:35 UTC

Description Huzaifa S. Sidhpurwala 2011-12-29 10:44:45 UTC
Julian Wälde and Alexander Klink reported a flaw in the hash function used in
the implementation of the JRuby arrays implemented using the hash table.

A specially-crafted set of keys could trigger hash function collisions, which
degrade hash table performance by changing hash table operations complexity
from an expected/average O(1) to the worst case O(n).  Reporters were able to
find colliding strings efficiently using equivalent substrings or meet in the
middle techniques.

As various web application frameworks for Ruby automatically pre-fill certain
arrays with data from the HTTP request (such as GET or POST parameters) for
Ruby web applications, a remote attacker could use this flaw to make the Ruby
interpreter use an excessive amount of CPU time by sending a POST request with
a large number parameters which hash to the same value.

This problem is similar to the issue that was previously reported for and fixed
in e.g. perl:

Note: This issue have been fixed in version of JRuby

Comment 2 Huzaifa S. Sidhpurwala 2011-12-29 10:48:22 UTC
Created jruby tracking bugs for this issue

Affects: fedora-16 [bug 770821]

Comment 4 David Jorm 2012-01-03 02:00:39 UTC
JBoss Enterprise SOA Platform 5.2.0 ships JRuby 1.6.5 as part of the scripting_chain quickstart sample application. JRuby 1.6.5 exposes this flaw, although the sample application itself does not appear to expose the flaw. If the version of JRuby shipped with the scripting_chain sample application was used to build a custom application, then this flaw could be exposed. Bugs have been filed to update the sample application to use JRuby


Comment 8 Murray McAllister 2012-07-02 23:43:01 UTC

Red Hat would like to thank oCERT for reporting this issue. oCERT acknowledges Julian Wälde and Alexander Klink as the original reporters.

Comment 9 errata-xmlrpc 2012-07-31 14:33:40 UTC
This issue has been addressed in following products:

  JBoss Enterprise SOA Platform 5.3.0

Via RHSA-2012:1125 https://rhn.redhat.com/errata/RHSA-2012-1125.html

Comment 10 Jan Lieskovsky 2012-11-12 11:24:44 UTC
Relevant upstream patch:

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