Bug 682332 - (CVE-2011-0188) CVE-2011-0188 ruby: memory corruption in BigDecimal on 64bit platforms
CVE-2011-0188 ruby: memory corruption in BigDecimal on 64bit platforms
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
public=20110301,reported=20110228,sou...
: Security
Depends On: 709957 709958 709959 709963 709964
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-04 16:13 EST by Vincent Danen
Modified: 2011-08-04 10:50 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-06-29 10:35:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Vincent Danen 2011-03-04 16:13:44 EST
Drew Yao of Apple Product Security reported a flaw in how Ruby's BigDecimal implementation.  In a 64-bit program, if the amount of memory to allocate is greater than 2^32, the allocated amount will be truncated to a 32-bit unsigned integer, however the amount to memset will use the full 64-bit number, leading to a crash or memory corruption.  After the memset, the unexpectedly small buffer could be used in other ways that lead to memory corruption or, possibly, code execution.

This flaw only affects 64-bit processes.

To test whether or not ruby is vulnerable, the following can be used (on a vulnerable ruby it will cause a segfault):

$ ruby -e 'require "bigdecimal"; BigDecimal.new("8").**(0x20000000)'

Upstream committed the following to fix the flaw:

http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ext/bigdecimal/bigdecimal.c?r1=29364&r2=30993
Comment 19 Vincent Danen 2011-06-28 12:50:40 EDT
Acknowledgements:

Red Hat would like to thank Drew Yao of the Apple Product Security team for reporting this issue.
Comment 20 errata-xmlrpc 2011-06-28 13:22:42 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 4

Via RHSA-2011:0908 https://rhn.redhat.com/errata/RHSA-2011-0908.html
Comment 21 errata-xmlrpc 2011-06-28 13:33:35 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 6

Via RHSA-2011:0910 https://rhn.redhat.com/errata/RHSA-2011-0910.html
Comment 22 errata-xmlrpc 2011-06-28 13:34:09 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2011:0909 https://rhn.redhat.com/errata/RHSA-2011-0909.html
Comment 23 Vincent Danen 2011-06-29 10:23:20 EDT
Statement:

(none)

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