CVE-2026-49970
Deferred Deferred - Pending Action

Path Traversal in Laravel-Mediable File Upload

Vulnerability report for CVE-2026-49970, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-13

Last updated on: 2026-07-14

Assigner: VulnCheck

Description

Laravel-Mediable before 7.0.0 contains a path traversal vulnerability in the File::sanitizePath() function that allows attackers to write uploaded files to arbitrary locations by controlling the directory argument passed to MediaUploader::toDestination(). Attackers can exploit the permissive character-class regex that allows both dot and slash characters combined with an ineffective trailing trim() call to bypass sanitization and upload files to sensitive locations such as the document root, environment configuration files, or application configuration directories, enabling remote code execution.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-13
Last Modified
2026-07-14
Generated
2026-08-03
AI Q&A
2026-07-14
EPSS Evaluated
2026-08-01
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
plank laravel-mediable to 7.0.0 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-22 The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-49970 is a path traversal vulnerability in the Laravel-Mediable package before version 7.0.0. The vulnerability exists in the File::sanitizePath() function, which is responsible for sanitizing file paths during uploads.

Attackers can exploit this flaw by controlling the directory argument passed to MediaUploader::toDestination(). The function uses a permissive character-class regex that allows both dot (.) and slash (/) characters, combined with an ineffective trailing trim() call. This enables attackers to bypass path sanitization and write uploaded files to arbitrary locations.

For example, attackers can use directory traversal patterns like ../ or ./ to upload files to sensitive locations such as the document root, environment configuration files, or application configuration directories. This can lead to remote code execution if malicious files are uploaded and executed.

Detection Guidance

To detect the CVE-2026-49970 vulnerability on your system, you can check the installed version of the Laravel-Mediable package. The vulnerability affects versions before 7.0.0.

  • Check the installed version of Laravel-Mediable using Composer. Run the following command in your Laravel project directory: `composer show plank/laravel-mediable`. This will display the installed version.
  • Review your application's file upload functionality, particularly where the `MediaUploader::toDestination()` method is used. Look for instances where user-controlled input is passed as the directory argument.
  • Inspect your application's logs for unusual file upload patterns, such as requests containing directory traversal sequences like `../` or `./` in file paths.
  • Search your codebase for calls to `File::sanitizePath()` and verify that the paths being sanitized are not derived from untrusted user input without proper validation.
Impact Analysis

This vulnerability can have severe impacts if exploited, including:

  • Remote Code Execution (RCE): Attackers can upload malicious files to sensitive locations, such as the document root or application directories, and execute arbitrary code on the server.
  • Unauthorized File Uploads: Attackers can write files to arbitrary locations, potentially overwriting critical system or application files, leading to data corruption or system compromise.
  • Privilege Escalation: If the uploaded files are executed with elevated privileges, attackers may gain higher levels of access to the system.
  • Data Breaches: Sensitive files, such as environment configurations or application settings, could be accessed or modified, leading to unauthorized disclosure of sensitive information.

The CVSS v4.0 score of 8.7 and v3.1 score of 8.8 indicate a high severity, meaning the vulnerability poses a significant risk if left unpatched.

Compliance Impact

This vulnerability can impact compliance with several common standards and regulations, including:

  • GDPR (General Data Protection Regulation): If the vulnerability leads to unauthorized access or disclosure of personal data, it could result in a violation of GDPR. Organizations may face significant fines and legal consequences for failing to protect personal data adequately.
  • HIPAA (Health Insurance Portability and Accountability Act): For organizations handling protected health information (PHI), this vulnerability could lead to unauthorized access or modification of PHI, resulting in non-compliance with HIPAA. This may lead to penalties and reputational damage.
  • PCI DSS (Payment Card Industry Data Security Standard): If the vulnerability affects systems processing payment card data, it could lead to non-compliance with PCI DSS requirements for securing cardholder data. This may result in fines or loss of payment processing capabilities.
  • ISO 27001: This standard requires organizations to implement controls to protect information assets. A vulnerability like this could indicate a failure to meet ISO 27001 requirements for secure file handling and access control, potentially leading to non-compliance.

Exploitation of this vulnerability could also lead to breaches of contractual obligations, industry-specific regulations, or internal security policies, depending on the nature of the data and systems affected.

Mitigation Strategies

To mitigate CVE-2026-49970, follow these immediate steps:

  • Upgrade the Laravel-Mediable package to version 7.0.0 or later. Run the following command to update: `composer require plank/laravel-mediable:^7.0.0`.
  • If upgrading is not immediately possible, apply the patch manually by modifying the `sanitizePath()` function in the `File` class to strip directory traversal characters (e.g., `../`, `./`). Refer to the commit in Resource 3 for the exact changes.
  • Review and restrict file upload destinations to trusted directories only. Avoid passing user-controlled input directly to `MediaUploader::toDestination()`.
  • Enable the built-in `SvgSanitizer` or other custom sanitizers provided in Laravel-Mediable 7.0.0 to prevent malicious file content from being uploaded. Configure this in the `mediable.file_sanitizers` array in your application's configuration.
  • Monitor file uploads for suspicious activity, such as attempts to upload files to sensitive directories (e.g., `.env`, `config/`).

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-49970. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart