REDHAT-BUG-682332: Medium severity Ruby BigDecimal vulnerability
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
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-682332?
The vulnerability REDHAT-BUG-682332 is considered to be a moderate severity issue.
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.
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.
What is the potential impact of REDHAT-BUG-682332?
The potential impact of REDHAT-BUG-682332 includes memory allocation failures and possible application crashes.
Who reported the vulnerability REDHAT-BUG-682332?
The vulnerability REDHAT-BUG-682332 was reported by Drew Yao from Apple Product Security.