Skip to content
RCE Write-up Beginner

The story

A Ruby on Rails debug console was left enabled on a subdomain, allowing anyone to execute Ruby code on the server. The author found it by running a debug-mode detection template and then noticing an interactive console at the bottom of the page.

Joshua Martinelle Follow

Published on jomar.fr

I originally wanted to name this article “The RCE that everyone missed”, but since it was too “clickbait”, this is the title you see now.

Joshua Martinelle (@J0_mart), on jomar.fr

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

How it worked

Root cause

Likely the Rails debug mode was left enabled in a production environment, exposing an interactive console.

Impact

An attacker could execute arbitrary Ruby code on the server, leading to remote code execution.

What the attacker needed

Rails debug mode enabled on a public host

The fix

The vulnerability was fixed the next day after the report was sent.

How it was found

  1. Run a template that detects Rails debug mode against a subdomain.
  2. Receive an alert that the template matched.
  3. Open the URL and confirm debug mode is active.
  4. Notice a Ruby console at the bottom of the page.
  5. Type a command and see its output returned.

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 write-up has not been written yet. The Original tab links to the source.

A debug console is a tool developers use to test code while building a site. If it is left switched on in a live site, anyone who finds it can run their own commands on the server, which is very dangerous.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Joshua Martinelle

View all

5 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.