Skip to content
File upload Write-up Beginner

PHPmotion <= 2.0 (update_profile.php) Unrestricted File Upload Vulnerability

PHPmotion 2.0 and earlier allowed authenticated users to upload a .php file disguised with an image content type, which could then be executed by requesting it directly. An attacker with an account could run arbitrary code on the server.

karmainsecurity.com

Published on karmainsecurity.com

Unrestricted file upload vulnerability in updateprofile.php in PHPmotion 2.0 and earlier allows remote authenticated users to execute arbitrary code by uploading a .php file with a content type of (1) image/gif, (2) image/jpeg, or (3) image/pjpeg, then accessing it via a direct request to the file under pictures/.

The author, on karmainsecurity.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 upload handler trusted the client-supplied content type and did not check the file extension or content, and stored uploads in a web-accessible directory that executes PHP.

Impact

An authenticated attacker could execute arbitrary code on the server, potentially taking full control of the application and its data.

What the attacker needed

A valid user account

How it was found

  1. Log in to the application.
  2. Upload a .php file while setting the content type to an image type.
  3. Request the uploaded file directly under pictures/ to execute it.

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 upload feature accepted a PHP script as if it were a picture, because it only checked the claimed file type. When the uploaded file was opened in the browser, the server ran it as code instead of showing an image, letting the attacker control 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.