/

CVE-2020-36942

Severity:

HIGH RISK

(8.8)

Unrestricted File Upload in Victor CMS Profile Image Feature

CVE-2020-36942

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

Victor CMS 1.0 suffers from an unrestricted file upload vulnerability in the profile image upload feature, enabling authenticated users to upload arbitrary PHP files.

By placing a PHP web shell into the /img directory and accessing it via a browser, an attacker can execute system commands on the underlying server with the web server's privileges.

Affected context

The vulnerability appears in the profile image upload functionality of Victor CMS 1.0.

It manifests when user-controlled upload endpoints accept files without sufficiently enforcing type restrictions, content validation, or executable placement rules.

The risk is highest in deployments where the /img directory (or similar upload path) is web-accessible and the server is configured to execute PHP code in that directory.

Exploit preconditions

  • Attack surface: Authenticated web interface (profile image upload endpoint).
  • Required access: Valid user account or any credentials that can reach the profile upload functionality.
  • Trigger point: Uploading a crafted PHP file via the image upload form, which is then stored under a web-accessible path (e.g., /img).
  • Why exploitation is possible: The application does not sufficiently restrict allowed file types, does not reliably validate or sanitize the uploaded file content, and stores uploads in a directory where PHP execution is enabled, allowing direct invocation of the uploaded script via HTTP.

Why this happens

This issue stems from improper handling of user-supplied files in the upload mechanism, corresponding to CWE-434: Unrestricted Upload of File with Dangerous Type.

Instead of enforcing strict file-type controls, the application allows arbitrary content (including PHP scripts) to be uploaded under the guise of an image.

Additionally, these files are stored in a directory configured to execute server-side code, which converts a simple upload flaw into direct remote code execution.

Abstractly, the insecure pattern is: accepting untrusted files, performing weak or no validation, and placing them in an executable context accessible over the network.

Potential impact

  • Execution of arbitrary system commands with the web server's privileges via uploaded PHP shells.
  • Full compromise of the Victor CMS instance, including modification or theft of application data.
  • Use of the compromised server as a pivot point for further attacks inside the hosting environment.
  • Deployment of malware, phishing pages, or defacements served from the affected site.
  • Loss of integrity and availability of the CMS content and underlying system.

General mitigation guidance

Effective mitigations center on reducing the trust placed in uploaded files and eliminating executable upload paths:

  • Enforce strict allowlists for file types (e.g., only common image MIME types and extensions) and verify both client- and server-side.
  • Perform content-based validation (e.g., checking magic numbers) rather than trusting file extensions or user-supplied headers.
  • Store uploaded files outside of web-executable directories, serving them via a layer that treats them as static content only.
  • Configure the web server to disable script execution (PHP or other interpreters) in upload directories.
  • Apply least-privilege to the web server process and isolate the file upload handling logic where possible.
  • Introduce centralized upload-handling components or libraries that implement these safe-by-default patterns across the application.

How teams detect issues like this

Detection generally relies on a combination of code-level and operational signals:

  • Static analysis: Search for file upload endpoints that:
  • Accept arbitrary file types.
  • Write directly to web-accessible paths.
  • Lack MIME-type enforcement, extension checks, or content inspection.
  • Code review cues: Look for usages of move_uploaded_file-like APIs or file write operations that:
  • Are triggered by user input fields (e.g., profile photo upload).
  • Do not pass through centralized validation or sanitization routines.
  • Configuration review: Inspect web server and PHP (or other runtime) configuration for:
  • Direct execution enabled in upload directories.
  • Absence of open_basedir-like restrictions or directory-level Options/php_admin_value controls.
  • Runtime monitoring: Use WAF rules or intrusion detection signatures to flag:
  • Upload requests with executable extensions (e.g., .php, .php5, .phtml).
  • Subsequent HTTP requests directly invoking newly uploaded files.
  • Automated security testing tools and CI-integrated scanners can be configured to check for unrestricted file upload patterns and dangerous directory configurations.

Sources

SourceLink
github.comgithub.com/VictorAlagwu/CMSsite
exploit-db.comexploit-db.com/exploits/49310
vulncheck.comvulncheck.com/advisories/victor-cms-file-upload-to-rce

Frequently asked

questions

Yes, it is remotely exploitable by anyone who can authenticate to the application and access the profile image upload feature. Once logged in, the attacker can upload and then invoke a malicious PHP file over HTTP.

Not necessarily. The description indicates that "authenticated users" can exploit it, which often includes low-privileged or normal user accounts, as long as those accounts have access to the image upload functionality.

The most robust pattern is to treat all uploads as untrusted content: strictly validate allowed file types, store uploads in non-executable locations, disable code execution in upload directories, and centralize upload handling so these safeguards are consistently applied.

Adopt a secure upload design from the outset: define a clear allowlist of permitted file types, implement content-based validation, ensure uploaded files are never placed in executable directories, and institutionalize security reviews and automated checks around any new upload features.

Find out what's already
exploitable in your codebase.