Skip to content
RCE Disclosed report Intermediate

Reflected File Download attack allows attacker to 'upload' executables to hackerone.com domain

The notifications endpoint reflected a user-controlled bug title into a file download with a .bat extension, allowing an attacker to craft a malicious executable hosted on the hackerone.com domain. A victim who downloaded and ran the file would execute attacker-controlled commands on their Windows machine.

rickypaipie Follow

Originally disclosed on HackerOne

  • Triaged in under an hour
  • Fixed in 2 days
  • Disclosed after 38 days

Hi hackerone team,

I'm a friend of Peiying and am looking for a position at hackerone. While playing around with your product, I found a serious vulnerability in your application: it allows attackers to craft executables on the hackerone.com domain rather than the sandboxed one on S3.

  1. attacker reports a bug titled hackerone\"||calc||
  2. attacker can then direct victim to https://hackerone.com/notifications.bat
  3. when downloaded and executed, it will open calculator on victim's windows environment

The potentials of this vector is outlined in Reflected File Download: A New Web Attack Vector, which does not limit to executing commands on victim's machines.

To fix, since hackerone is a Rails deployment, at the rendering step of the notifications action:

instead of:

render json: notifications

do:

respond_to do |format|
    format.json do
        render json: notifications
    end
end

so requests of non-json formats would return a 406 Not Acceptable. see respond_to.

Look forward to hearing back from you soon,

Ricky

Attachments

rfd.jpg
rfd.jpg From the original on HackerOne

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

Root cause

Likely the notifications action rendered JSON for any requested format, so a .bat URL returned a batch file containing the reflected bug title.

Impact

An attacker could make a victim download and run an executable from the trusted hackerone.com domain, executing commands such as opening the calculator on Windows.

What the attacker needed

Attacker can report a bug; victim clicks a link and runs the file; victim uses Windows

The fix

The notifications action should only respond to JSON format requests, returning 406 Not Acceptable for other formats.

How it was found

  1. Attacker reports a bug with a title containing command syntax.
  2. Attacker sends the victim a link to the notifications endpoint ending in .bat.
  3. The victim downloads and executes the file, which runs the embedded command.

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.

When you report a bug, its title is stored and later shown back to you. The site also let you download that data as a file, and it chose the file type from the URL. By naming the file with a .bat ending, the attacker made the browser save a Windows script that runs commands when opened. The danger is that the file appears to come from the trusted hackerone.com domain.

What is RCE?

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

More from HackerOne

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.