Skip to content
Memory corruption Disclosed report Advanced

Struct type confusion RCE

A type confusion vulnerability in mruby allows an attacker to control the instruction pointer, leading to a crash at an attacker-chosen address. The reporter suggests that with additional primitives, full remote code execution could be achieved.

h72 Follow

Originally disclosed on HackerOne

Bounty$18,000 Critical View original
  • Triaged in 40 hours
  • Fixed in 6 days
  • Paid in 34 days
  • Disclosed after 34 days

Heya!

I've been poking at mruby a bit more and I've found a vulnerability that allows an attacker to take control of the instruction pointer.

I've attached a proof of concept script that when run in mruby will jump to 0x0000133713371337 and segfault.

While the proof of concept script just jumps to an attacker controlled address and crashes, it would almost certainly be possible to achieve full remote code execution, especially given an arbitrary read/write primitive (which is easily created using the same techniques as in the proof of concept)

The proof of concept script has detailed annotations throughout about how it works, but I'm also happy to clarify anything if need be :)

Cheers,

███████

The original report as published on HackerOne, by h72. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could take control of the instruction pointer, causing a crash, and potentially achieve full remote code execution.

What the attacker needed

Ability to run mruby script

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

mruby is a lightweight version of the Ruby programming language. A type confusion bug means the program misinterprets what kind of data it is handling, which can let an attacker trick it into running their own code. Here, the attacker can make the program jump to a memory address they choose, which usually crashes it but could be used to run malicious code.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by h72

View all

6 more disclosed reports, best first.

More from shopify-scripts

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.