Skip to content
File upload Write-up Intermediate

Unrestricted File Upload on /frontend-filemanager

The file manager endpoint was reachable without authentication even though it was meant for administrators, and the server only checked the upload's declared content type. An attacker could upload a PHP webshell disguised as an image with a .phtml extension and run code on the server.

medium.com

Published on medium.com

Pada aplikasi web target ditemukan kelemahan pada fitur File Manager yang dapat diakses melalui endpoint /frontend-filemanager. Secara desain, fitur ini seharusnya hanya tersedia untuk pengguna dengan hak akses administrator.

pov.isamm, on medium.com

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 endpoint lacked an authorisation check and the upload handler trusted the client-supplied content type and filename extension instead of validating the file content and blocking executable extensions.

Impact

An attacker could execute code on the server, take it over, add backdoors, steal data and pivot to internal services.

What the attacker needed

No authentication needed; server accepts .phtml uploads

The fix

The endpoint should require authentication and administrator rights, uploads should be validated by extension whitelist, MIME type and magic bytes, files should be stored outside executable directories with PHP execution disabled, and executable extensions should be blocked.

How it was found

  1. Open the file manager endpoint without logging in.
  2. Find the upload feature in the file manager interface.
  3. Create an image file with a PHP webshell appended at the end.
  4. Intercept the upload request and change the filename extension to .phtml.
  5. Send the modified request and confirm the server replies OK.
  6. Access the uploaded file to reach the webshell.

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 file manager is a page for uploading and managing files on a website. Here anyone could open it without logging in, and the server trusted the file type the browser claimed instead of checking the file itself. That let someone upload a script disguised as a picture and get it executed by the 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.

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.