First published: Fri Mar 04 2011(Updated: )
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: <a href="http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ext/bigdecimal/bigdecimal.c?r1=29364&r2=30993">http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ext/bigdecimal/bigdecimal.c?r1=29364&r2=30993</a>
Credit: product-security@apple.com
Affected Software | Affected Version | How to fix |
---|---|---|
Ruby | <=1.9.2-p136 | |
Ruby | =1.9 | |
Ruby | =1.9-r18423 | |
Ruby | =1.9.0 | |
Ruby | =1.9.0-r18423 | |
Ruby | =1.9.0-0 | |
Ruby | =1.9.0-1 | |
Ruby | =1.9.0-2 | |
Ruby | =1.9.0-20060415 | |
Ruby | =1.9.0-20070709 | |
Ruby | =1.9.1 | |
Ruby | =1.9.1--p0 | |
Ruby | =1.9.1--p129 | |
Ruby | =1.9.1--p243 | |
Ruby | =1.9.1--p376 | |
Ruby | =1.9.1--p429 | |
Ruby | =1.9.1--preview_1 | |
Ruby | =1.9.1--preview_2 | |
Ruby | =1.9.1--rc1 | |
Ruby | =1.9.1--rc2 | |
Ruby | =1.9.2 | |
Ruby | =1.9.2-dev | |
Apple iOS and macOS | =10.5.8 | |
Apple iOS and macOS | =10.6.0 | |
Apple iOS and macOS | =10.6.1 | |
Apple iOS and macOS | =10.6.2 | |
Apple iOS and macOS | =10.6.3 | |
Apple iOS and macOS | =10.6.4 | |
Apple iOS and macOS | =10.6.5 | |
Apple iOS and macOS | =10.6.6 | |
Apple macOS Server | =10.5.8 | |
Apple macOS Server | =10.6.0 | |
Apple macOS Server | =10.6.1 | |
Apple macOS Server | =10.6.2 | |
Apple macOS Server | =10.6.3 | |
Apple macOS Server | =10.6.4 | |
Apple macOS Server | =10.6.5 | |
Apple macOS Server | =10.6.6 |
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ext/bigdecimal/bigdecimal.c?r1=29364&r2=30993
Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.
CVE-2011-0188 is considered to have a moderate severity due to the potential memory allocation issues in Ruby's BigDecimal implementation.
To fix CVE-2011-0188, upgrade Ruby to a version later than 1.9.2-p136 that addresses this vulnerability.
CVE-2011-0188 affects Ruby versions up to and including 1.9.2-p136.
No, CVE-2011-0188 does not affect macOS versions stated in the vulnerability report.
CVE-2011-0188 represents a memory truncation issue that could potentially lead to unexpected behavior in applications using Ruby.