/

CVE-2025-70151

Severity:

HIGH RISK

(8.8)

Unrestricted File Upload in Scholars Tracking System

CVE-2025-70151

Analyzed

Vulnerability type

Category:

Unrestricted File Upload

CWE:

CWE-434

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Scholars Tracking System 1.0 contains an unrestricted file upload vulnerability in the profile picture upload endpoints that allows authenticated users to upload arbitrary files into a web-accessible directory.

By uploading a PHP script as a profile image and then accessing it via the public uploads/ path, an attacker can execute arbitrary code on the server with the privileges of the web server process.

Affected context

The vulnerability occurs in the Scholars Tracking System 1.0 application where user profile images are handled by update_profile_picture.php and upload_picture.php.

These endpoints accept user-supplied files, store them under their original filenames, and place them in a web-accessible uploads/ directory.

In deployments where the web server is configured to execute PHP files from this directory, any uploaded PHP file can be run as application code.

Exploit preconditions

  • Attack surface: HTTP endpoints update_profile_picture.php and upload_picture.php exposed to authenticated users.
  • Required access: Valid authenticated account with permission to upload or change a profile image.
  • Trigger point: Uploading a file with a PHP extension (or any server-executable type) and then making an HTTP request to the resulting /uploads/<filename> path.
  • Why exploitation is possible: The application does not validate file type or extension, preserves user-supplied filenames, and stores them in an executable webroot directory, enabling direct execution of attacker-controlled code.

Why this happens

The core issue is the lack of server-side constraints on which files can be uploaded and how they are stored.

The upload handlers:

  • Do not verify the MIME type, extension, or content of the uploaded file.
  • Preserve the original filename provided by the user.
  • Store the file directly in a web-accessible directory that the server is configured to execute PHP from.

This aligns with CWE-434: Unrestricted Upload of File with Dangerous Type, where an application accepts arbitrary file types and places them in a context where they can be interpreted as active content by the server.

Potential impact

  • Execution of arbitrary PHP code on the server as the web server user.
  • Full compromise of the web application, including reading or modifying application data.
  • Installation of web shells or backdoors for persistent access.
  • Pivoting to other internal systems reachable from the compromised server.
  • Use of the server for further attacks, such as hosting malware or phishing pages.

General mitigation guidance

Effective mitigation focuses on treating file uploads as untrusted data and ensuring they cannot be executed as code:

  • Restrict uploads to a strict allowlist of safe file types (e.g., specific image formats) with server-side validation based on both extension and content.
  • Normalize and regenerate filenames server-side instead of trusting user-supplied names.
  • Store uploaded files outside of any executable webroot, serving them via a controlled mechanism (e.g., a script that streams file bytes).
  • Configure the web server to never execute scripts (PHP or other) in upload directories, treating them as static content only.
  • Apply least-privilege permissions to the upload directory so that even if misused, the blast radius is reduced.

How teams detect issues like this

Detection typically involves a mix of code-level review and runtime monitoring:

  • Static analysis / code review:
  • Flag upload handlers that write files to web-accessible paths without extension or content checks.
  • Look for use of user-supplied filenames in filesystem paths, especially under directories served by the web server.
  • Identify directories configured to execute scripts that are also used as general upload locations.
  • Configuration and policy checks:
  • Enforce policies that prevent executable handlers (e.g., PHP) from being enabled on upload paths.
  • Use automated compliance checks to validate web server configuration against secure baselines.
  • Runtime monitoring:
  • Log and review file uploads, including filenames, paths, and MIME types.
  • Monitor for execution of new or unusual scripts from upload directories and alert on anomalous behavior.

Sources

SourceLink
code-projects.orgcode-projects.org/scholars-tracking-system-in-php-with-source-code/
youngkevinn.github.ioyoungkevinn.github.io/posts/CVE-2025-70151-Scholars-FileUpload-RCE/

Frequently asked

questions

Yes, it can be exploited remotely by any attacker who can authenticate to the application and access the affected upload endpoints, as long as the uploaded files are reachable and executable via the web server.

The described issue requires an authenticated account with the ability to upload or update a profile picture. No additional elevated privileges are typically required beyond that basic role.

The safest approach is to store uploaded files outside of any executable webroot, generate safe server-side filenames, enforce a strict allowlist of permitted file types, and configure the web server so that upload directories are treated as static content only.

Establish a standard upload handling component or service that centralizes file validation, naming, and storage rules; enforce non-executable storage locations in infrastructure templates; and incorporate security review and automated checks for any new file upload functionality before deployment.

Find out what's already
exploitable in your codebase.