CVE-2011-0188: Medium severity ruby vulnerability

Published Mar 4, 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:

http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ext/bigdecimal/bigdecimal.c?r1=29364&r2=30993

Other sources

The VpMemAlloc function in bigdecimal.c in the BigDecimal class in Ruby 1.9.2-p136 and earlier, as used on Apple Mac OS X before 10.6.7 and other platforms, does not properly allocate memory, which allows context-dependent attackers to execute arbitrary code or cause a denial of service (application crash) via vectors involving creation of a large BigDecimal value within a 64-bit process, related to an "integer truncation issue."

Affected Software

38 affected components
ruby-lang ruby<=1.9.2-p136
ruby-lang ruby=1.9
ruby-lang ruby=1.9-r18423
ruby-lang ruby=1.9.0
ruby-lang ruby=1.9.0-r18423
ruby-lang ruby=1.9.0-0
ruby-lang ruby=1.9.0-1
ruby-lang ruby=1.9.0-2
ruby-lang ruby=1.9.0-20060415
ruby-lang ruby=1.9.0-20070709
ruby-lang ruby=1.9.1
ruby-lang ruby=1.9.1--p0
ruby-lang ruby=1.9.1--p129
ruby-lang ruby=1.9.1--p243
ruby-lang ruby=1.9.1--p376
ruby-lang ruby=1.9.1--p429
ruby-lang ruby=1.9.1--preview_1
ruby-lang ruby=1.9.1--preview_2
ruby-lang ruby=1.9.1--rc1
ruby-lang ruby=1.9.1--rc2
ruby-lang ruby=1.9.2
ruby-lang 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 Mac OS X Server=10.5.8
Apple Mac OS X Server=10.6.0
Apple Mac OS X Server=10.6.1
Apple Mac OS X Server=10.6.2
Apple Mac OS X Server=10.6.3
Apple Mac OS X Server=10.6.4
Apple Mac OS X Server=10.6.5
Apple Mac OS X Server=10.6.6

Event History

Mar 4, 2011
Data Sourced
via Red Hat·09:13 PM
DescriptionSeverityAffected Software
Mar 23, 2011
CVE Published
via MITRE·01:00 AM
Data Sourced
via MITRE·01:00 AM
Description
Data Sourced
02:00 AM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2011-0188?

CVE-2011-0188 is considered to have a moderate severity due to the potential memory allocation issues in Ruby's BigDecimal implementation.

2

How do I fix CVE-2011-0188?

To fix CVE-2011-0188, upgrade Ruby to a version later than 1.9.2-p136 that addresses this vulnerability.

3

Which versions of Ruby are affected by CVE-2011-0188?

CVE-2011-0188 affects Ruby versions up to and including 1.9.2-p136.

4

Does CVE-2011-0188 affect macOS?

No, CVE-2011-0188 does not affect macOS versions stated in the vulnerability report.

5

What kind of issue does CVE-2011-0188 represent?

CVE-2011-0188 represents a memory truncation issue that could potentially lead to unexpected behavior in applications using Ruby.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203