Skip to content
File upload Disclosed report Beginner

Remote code execution due to unvalidated file upload

The profile picture upload accepted any file type, including PHP scripts, and the uploaded file was stored with a predictable path that could be accessed directly. An attacker could upload a malicious PHP file and execute it on the server, potentially leading to remote code execution or website defacement.

aliyugombe Follow

Originally disclosed on HackerOne

Critical View original
  • Triaged in 3 days
  • Fixed in 16 months
  • Disclosed after 17 months

Summary:

Hello I found a critical vunerability in one of your site, where user can upload any file type as a profile picture (including php file)

Steps To Reproduce:

  1. Visit https://careers.mtn.cm and register as a user.
  2. After successful registration, login and update your data.
  3. When uploading profile photo, select any file type.
  4. When its updated, view the source code of the page, you will see your file with complete path.
  5. Copy the file path and paste into your browser.
  6. Boom your file will be executed

Supporting Material/References:

Here i upload non-harmful file as a poc

<?php
echo "proof of concept (PoC) by [email protected]";
?>

https://careers.mtn.cm/en/user/images/users/-13-04-2021-20-15-16-payload.php

Impact

Attacker can upload malicious file and inject to your server or deface the entire website since its possible to upload php file and gain access to direct file path.

The original report as published on HackerOne, by aliyugombe. 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 upload feature did not validate the file type or extension, and the uploaded files were stored in a web-accessible directory where the server executed them.

Impact

An attacker could upload a malicious file and execute it on the server, potentially gaining access or defacing the entire website.

What the attacker needed

A free account on the site; ability to upload a profile picture

How it was found

  1. Register as a user on the careers site.
  2. Log in and update your profile data.
  3. Upload a file of any type as the profile photo.
  4. View the page source to find the full path of the uploaded file.
  5. Copy the file path and paste it into the browser.
  6. The uploaded file is executed by the server.

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 website let people upload a picture for their profile, but it did not check what kind of file was uploaded. Someone uploaded a small program written in PHP (a language used to build websites) instead of an image. Because the server ran that file when it was opened in a browser, the attacker could run their own code on the website's server.

What is File upload?

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.

More by aliyugombe

View all

13 more disclosed reports, best first.

More from MTN Group

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.