Bug 682332 (CVE-2011-0188) - CVE-2011-0188 ruby: memory corruption in BigDecimal on 64bit platforms
Summary: CVE-2011-0188 ruby: memory corruption in BigDecimal on 64bit platforms
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2011-0188
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: 709957 709958 709959 709963 709964
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-04 21:13 UTC by Vincent Danen
Modified: 2023-05-13 01:36 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-06-29 14:35:02 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0908 0 normal SHIPPED_LIVE Moderate: ruby security update 2011-06-28 17:22:27 UTC
Red Hat Product Errata RHSA-2011:0909 0 normal SHIPPED_LIVE Moderate: ruby security update 2011-06-28 17:33:49 UTC
Red Hat Product Errata RHSA-2011:0910 0 normal SHIPPED_LIVE Moderate: ruby security update 2011-06-28 17:33:22 UTC

Description Vincent Danen 2011-03-04 21:13:44 UTC
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 16:50:40 UTC
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 17:22:42 UTC
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 17:33:35 UTC
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 17:34:09 UTC
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 14:23:20 UTC
Statement:

(none)


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