Buffer overflow in Ruby - CVE-2016-2339
Published: January 6, 2017 / Updated: August 9, 2020
Vulnerability details
The vulnerability allows a remote non-authenticated attacker to execute arbitrary code.
An exploitable heap overflow vulnerability exists in the Fiddle::Function.new "initialize" function functionality of Ruby. In Fiddle::Function.new "initialize" heap buffer "arg_types" allocation is made based on args array length. Specially constructed object passed as element of args array can increase this array size after mentioned allocation and cause heap overflow.
Affected software
Ubuntu
Opensuse
libruby1.9.1 (Ubuntu package)
ruby1.9.1 (Ubuntu package)
libruby2.0 (Ubuntu package)
ruby2.0 (Ubuntu package)
libruby2.3 (Ubuntu package)
ruby2.3 (Ubuntu package)
How to mitigate CVE-2016-2339
ruby1.9.1 (Ubuntu package) - update to 1.9.3.484-2ubuntu1.3
libruby2.0 (Ubuntu package) - update to 2.0.0.484-1ubuntu2.4
ruby2.0 (Ubuntu package) - update to 2.0.0.484-1ubuntu2.4
libruby2.3 (Ubuntu package) - addressed in versions 2.3.1-2~16.04.2, 2.3.3-1ubuntu0.1
ruby2.3 (Ubuntu package) - addressed in versions 2.3.1-2~16.04.2, 2.3.3-1ubuntu0.1