/

CVE-2026-93352

Severity:

CRITICAL RISK

(9.8)

Unrestricted Upload (CWE-434) in Laravel-Mediable Package

CVE-2026-93352

Deferred

Vulnerability type

Category:

Unrestricted File Upload

CWE:

CWE-434

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(9.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

Laravel-Mediable contains an incomplete file-extension blocklist that allows files using the .pht extension to pass upload validation. On deployments where the web server treats .pht files as PHP, an attacker who can upload media may achieve remote code execution with the privileges of the web server process.

Affected context

The vulnerability occurs in Laravel-Mediable deployments that use the affected validation and sanitization logic and permit users or external systems to upload files. Risk is higher when the upload directory is web-accessible and the server configuration maps .pht files to the PHP interpreter, as can occur with certain Apache configurations on Debian- or Ubuntu-based systems.

Exploit preconditions

  • Attack surface: Media or file upload functionality exposed by the Laravel-Mediable application
  • Required access: Authorization to submit an upload, or another condition that permits an attacker to place a file through the application
  • Trigger point: File validation followed by storage in a web-accessible location and subsequent HTTP access
  • Why exploitation is possible: The extension blocklist omits .pht, allowing the file to be stored; a compatible web-server handler may then process it as PHP rather than as inert content

Why this happens

The underlying issue is an incomplete denylist for executable file extensions. Although the validation logic blocks some PHP-related extensions, it does not account for .pht, creating a mismatch between application-level validation and web-server execution behavior. This maps to CWE-434: Unrestricted Upload of File with Dangerous Type, because a potentially executable file can cross the upload boundary and reach a location where it may be interpreted as server-side code.

Potential impact

  • An attacker may execute arbitrary code with the privileges of the web server process
  • The application and its hosted data could be compromised
  • Credentials, environment variables, or connected services could be exposed
  • Uploaded content could be altered or used to facilitate persistence
  • The server may be used for lateral movement or further attacks

General mitigation guidance

Mitigation generally focuses on making uploaded content non-executable by design rather than relying solely on extension blocklists.

Common defensive patterns include:

  • Store uploads outside the web document root or serve them through a controlled download handler
  • Use an allowlist of expected file types and validate content independently of the filename
  • Normalize filenames and reject ambiguous, executable, or server-interpreted extensions
  • Configure the web server and runtime so user-uploaded files cannot be executed as scripts
  • Apply least-privilege permissions to the web server and upload directories
  • Use isolated storage, constrained filesystem permissions, and resource limits where practical
  • Treat client-supplied filenames, MIME types, and extensions as untrusted metadata

How teams detect issues like this

Detection approaches may include:

  • Static analysis rules that identify extension denylists without corresponding allowlists or server-side execution controls
  • Code review checks for upload validation followed by writes into web-accessible directories
  • Configuration reviews for handlers that associate uncommon extensions with PHP or other interpreters
  • Monitoring for executable extensions, unexpected script content, or requests targeting uploaded files
  • Policy enforcement requiring uploads to use non-executable storage and controlled download paths
  • Automated security review tools that compare application upload behavior with web-server configuration

Sources

SourceLink
github.comgithub.com/plank/laravel-mediable/commit/8ddb0e5b300084e91ad2cb18a6e7bc768bb7b008
github.comgithub.com/plank/laravel-mediable/pull/396
github.comgithub.com/plank/laravel-mediable/releases/tag/7.0.2
vulncheck.comvulncheck.com/advisories/laravel-mediable-rce-via-pht-file-upload

Frequently asked

questions

It can be remotely exploitable when the application exposes an upload capability, stores submitted files in a web-accessible location, and the web server is configured to execute the relevant extension as PHP.

The attacker generally needs permission to upload media or another way to cause a file to be written through the application. The required level of authentication depends on the deployment's upload access controls.

Store user-uploaded files outside the executable web root and serve them through a controlled, non-executing download path. An extension allowlist and server-side execution restrictions should provide additional defense in depth.

Align application validation with web-server behavior, treat all upload metadata as untrusted, test uncommon executable extensions, and enforce policies that prohibit script execution in upload directories.

Find out what's already
exploitable in your codebase.