# Laravel-Mediable: path traversal vulnerability in the File::sanitizePath()

High severity, published 2026-07-13. Update plank/laravel-mediable to 7.0.0 or later: composer update plank/laravel-mediable.

Canonical URL: https://buzzphp.com/security/ghsa-xv8g-76mx-2rxc · Data from GitHub as of 2026-11-25.

| | |
| --- | --- |
| Severity | high (CVSS 8.8) |
| Published | 2026-07-13 |
| Updated | 2026-08-13 |
| CVE | [CVE-2026-49970](https://nvd.nist.gov/vuln/detail/CVE-2026-49970) |
| GHSA | [GHSA-xv8g-76mx-2rxc](https://github.com/advisories/GHSA-xv8g-76mx-2rxc) |
| Weakness | CWE-22 |

| Package | Affected versions | Fixed in |
| --- | --- | --- |
| plank/laravel-mediable | < 7.0.0 | 7.0.0 |

## What to do

Update plank/laravel-mediable to 7.0.0 or later: composer update plank/laravel-mediable.

Check which version you run with `composer show plank/laravel-mediable`, and every affected package with `composer audit`.

## About this advisory

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.

## Links

- [GHSA-xv8g-76mx-2rxc on GitHub](https://github.com/advisories/GHSA-xv8g-76mx-2rxc)
- [CVE-2026-49970 on the National Vulnerability Database](https://nvd.nist.gov/vuln/detail/CVE-2026-49970)
- [All Composer security advisories](https://buzzphp.com/security)
