Skip to content
Path traversal Disclosed report Intermediate

Overwrite any file of the web server

A module used to generate files let an attacker choose the output file path, so a crafted request could create or overwrite files anywhere on the web server. The reporter showed that a targeted PHP file was replaced with an empty page, and noted that attempts to inject PHP code for RCE failed with a 500 error.

goedix Follow

Originally disclosed on HackerOne

Critical 9.1 View original
  • Fixed in 30 days
  • Disclosed after 45 days

Summary:

With this vulnerability an attacker can override all the files from the server due to a vulnerable module used to generate █████████s

Steps To Reproduce:

  1. Go to ██████████ to check the actual payload (Save ███████ to:) to do it (███████goedix.php -> This will create a file in /██████_h1goedix.php but this can be edited to index.php and replacing any php file in the server or outside the web server) █████
  2. Go to ███████ to start the job that creates the ███ in the target filepath
  3. Go to https://██████████_h1goedix.php or the targeted file and check that it returns an empty page! ██████████

As note, if you want to do any action in /█████████ you must modify with burp the request from /█████████/index.php to /██████████, otherwises it won't work!

Impact

An attacker can replace all the server files with empty pages! (I was finding to achieve RCE but I was not able to do it (I did tests injecting php code into the php files but it returns 500 internal server error)

The original report as published on HackerOne, by goedix. 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 file-generation module accepted a user-controlled output path without restricting it to a safe directory.

Impact

An attacker could overwrite server files with empty pages; the reporter could not achieve RCE because injecting PHP code returned a 500 error.

What the attacker needed

Access to the file-generation feature; ability to set the output file path

How it was found

  1. Open the page that shows the payload and the save-to field.
  2. Change the save-to value to the target file path, such as an existing PHP page.
  3. Start the job that generates the file at that path.
  4. Request the targeted file and observe that it now returns an empty page.

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.

A part of the website that creates files for users did not check where the file should be saved. By changing that destination, the tester made the server write a file over an existing page, which then showed up empty. This is dangerous because important files can be wiped or replaced.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.