REDHAT-BUG-682332: Medium severity Ruby BigDecimal 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

Affected Software

1 affected component
Ruby BigDecimal<2^32

Event History

Mar 4, 2011
Data Sourced
09:13 PM
DescriptionSeverityAffected Software
May 13, 2023
Data Sourced
via Red Hat·01:36 AM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of REDHAT-BUG-682332?

The vulnerability REDHAT-BUG-682332 is considered to be a moderate severity issue.

2

How do I fix REDHAT-BUG-682332?

To fix REDHAT-BUG-682332, update Ruby's BigDecimal implementation to the latest version that addresses this allocation flaw.

3

What systems are affected by REDHAT-BUG-682332?

REDHAT-BUG-682332 affects Ruby BigDecimal on 64-bit systems that allocate memory greater than 2^32.

4

What is the potential impact of REDHAT-BUG-682332?

The potential impact of REDHAT-BUG-682332 includes memory allocation failures and possible application crashes.

5

Who reported the vulnerability REDHAT-BUG-682332?

The vulnerability REDHAT-BUG-682332 was reported by Drew Yao from Apple Product Security.

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