shopify-scripts · Report #185051
Type confusion in wrap_decimal leading to memory corruption
Validstatus
criticalseverity
35upvotes
15 Jan 2017disclosed
How it was found
Decimal can be redefined, causing the Decimal class lookup in wrap_decimal to be invalid. This can lead to memory corruption or arbitrary code execution.
The following snippet results in a native crash in mruby-engine olddecimal = Decimal.new(1) Decimal = Hash a = -olddecimal puts a
I suspect you caught this along with charliesome's similar bug for Struct. If not I'll follow up with a patch and an RCE exploit.