/

CVE-2019-25673

Severity:

HIGH RISK

(8.8)

Arbitrary File Upload in UniSharp Laravel File Manager

CVE-2019-25673

Deferred

Vulnerability type

Category:

Arbitrary File Upload

CWE:

CWE-434

Impact:

Remote Code Execution via Uploaded File

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

UniSharp Laravel File Manager v2.0.0-alpha7 and v2.0 contain an arbitrary file upload vulnerability that allows authenticated users to upload executable files via the upload endpoint.

By sending crafted multipart form data and abusing the type=Files parameter, an attacker can upload PHP code and then invoke it via the working directory path, leading to remote code execution on the server.

Affected context

This vulnerability appears in Laravel applications that embed UniSharp Laravel File Manager v2.0.0-alpha7 or v2.0 and expose its upload functionality to authenticated users.

The issue is relevant where:

  • The file manager's upload endpoint is reachable from user-controllable contexts (e.g., admin panels, media managers, or embedded editors).
  • Server-side validation of file type and content is weak or relies primarily on client-provided parameters, such as the type field.
  • Uploaded files are stored in a web-accessible directory where PHP or other scripts can be executed by the web server.

Exploit preconditions

  • Attack surface: HTTP(S) upload endpoint provided by UniSharp Laravel File Manager.
  • Required access: Valid authenticated session with permissions to access the file upload feature.
  • Trigger point: Submission of crafted multipart/form-data to the upload route, setting type=Files (or similar) to bypass intended media-type restrictions.
  • Why exploitation is possible: The server-side logic trusts the type parameter and performs insufficient validation on uploaded content and extensions, allowing executable PHP files to be stored in a directory that is executed by the PHP runtime when accessed via HTTP.

Why this happens

The underlying issue aligns with CWE-434: Unrestricted Upload of File with Dangerous Type.

The upload handler allows users to upload files with minimal server-controlled restrictions, relying on weak checks such as the type parameter and potentially superficial validation (e.g., extension or MIME checks that can be spoofed).

Because the application stores uploads under a web-accessible path where PHP execution is enabled, an attacker can upload a script file and later call it via the web server, effectively turning an upload feature into a code deployment and execution mechanism.

Potential impact

  • Remote execution of arbitrary PHP code on the application server.
  • Full compromise of the Laravel application, including reading or modifying application configuration and data.
  • Pivoting to the underlying operating system to install backdoors or conduct lateral movement.
  • Tampering with stored files, defacing hosted content, or exfiltrating sensitive assets.
  • Using the compromised server as a platform for further attacks or malware distribution.

General mitigation guidance

Effective mitigation centers on strictly controlling what can be uploaded and how uploads are stored and served:

  • Enforce an allowlist of safe file types on the server side (e.g., specific image formats) and validate by extension, MIME type, and, where feasible, file signatures.
  • Reject any file that could be interpreted as executable by the web server, including PHP, CGI, script files, and combinations like polyglots.
  • Store uploaded files outside of web-executable directories, and serve them via controlled download endpoints rather than direct filesystem paths.
  • Disable script execution in upload directories at the web server level (e.g., specific vhost or directory configuration).
  • Apply least-privilege filesystem permissions so that the application can write uploads but not modify critical code paths or configuration files.
  • Treat all configurable parameters (such as type) as untrusted hints, not authoritative indicators of safety.

How teams detect issues like this

Detection often involves combining code-level analysis with runtime monitoring:

  • Static analysis and code review:
  • Look for upload handlers that accept arbitrary file extensions or rely on client-provided parameters (like type) for validation.
  • Identify storage paths that are directly web-accessible and mapped to script-executing directories.
  • Flag any logic that lacks server-side allowlisted type checks or content inspection before saving files.
  • Configuration and policy checks:
  • Periodically scan webroot directories for unexpected script files under upload paths.
  • Enforce infrastructure policies that forbid script execution in upload directories.
  • Runtime monitoring:
  • Monitor logs for direct HTTP requests to uploaded files with executable extensions.
  • Use WAF or application firewalls to identify suspicious upload patterns, such as uploads of PHP files where only images are expected.

Automated SAST/DAST tools and CI-integrated security checks can help catch these patterns early, but should be supplemented with targeted manual review of file upload components.

Sources

SourceLink
github.comgithub.com/UniSharp/laravel-filemanager
github.comgithub.com/UniSharp/laravel-filemanager/issues/356
exploit-db.comexploit-db.com/exploits/46389
vulncheck.comvulncheck.com/advisories/unisharp-laravel-file-manager-alpha7-arbitrary-file-upload

Frequently asked

questions

Yes, it is remotely exploitable by anyone who can authenticate and reach the upload endpoint. The vulnerability does not require local system access, only network access to the web application and valid credentials with upload permissions.

The attack requires an authenticated account that has access to the file manager's upload functionality. If low-privileged or standard users have upload rights, the exposure is broader; if only administrators can upload, exploitation is limited to compromised or malicious admin accounts.

The safest approach is to implement strict server-side allowlisting of file types, block all executable formats, and ensure uploaded content is stored outside of any directory where the web server executes scripts. Additionally, configure the web server to disallow script execution in upload paths and remove any reliance on client-controlled parameters like type for trust decisions.

Treat file uploads as high-risk by default: design upload features with defense-in-depth, including strong validation, non-executable storage locations, restrictive filesystem and web server configurations, and regular security reviews of upload-related code. Incorporating security testing into your development lifecycle and using secure-by-default frameworks or modules for handling uploads can further reduce the chance of reintroducing this class of vulnerability.

Find out what's already
exploitable in your codebase.