Skip to content
File upload Write-up Beginner

CVE-2025–51414:Unrestricted file upload in Online Course Regist

The student profile photo upload in the Online Course Registration System does not validate file type or extension, so an authenticated student can upload a PHP file that is stored in a web-accessible directory and executed by the server. This leads to remote code execution.

Tanush Kushwah Follow

Published on medium.com

An Unrestricted File Upload vulnerability exists in PHPGurukul Online Course Registration System within the student profile update functionality.

Tanush Kushwah, 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

The application moves user-supplied files into a web-accessible directory without validating the file extension, MIME type, or content, and PHP execution is enabled in that directory.

Impact

An authenticated student can execute arbitrary commands on the web server, leading to full compromise of application data, file read/write, lateral movement, privilege escalation, and persistent backdoor access.

What the attacker needed

A valid student account

The fix

The upload should be fixed by enforcing strict server-side file type validation, whitelisting allowed extensions, storing files outside the web root, disabling script execution in upload directories, renaming files with random identifiers, and validating MIME type and content.

How it was found

  1. Log in using any valid student account.
  2. Navigate to the profile page at /my-profile.php.
  3. Under Student Photo, upload a file named shell.php containing PHP code.
  4. Access the uploaded file at /studentphoto/shell.php.
  5. Append a command parameter to the URL to execute a 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 write-up has not been written yet. The Original tab links to the source.

A file upload feature lets a user send a file to the server. Here the server saves whatever file is sent into a folder that anyone can browse and that also runs PHP code. So a student can upload a small program written in PHP and then open it in the browser to run commands on 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.

More by Tanush Kushwah

View all

1 more disclosed report, best first.

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.