Laravel-Mediable: path traversal vulnerability in the File::sanitizePath()
High severity. Published 13 July 2026. Update plank/laravel-mediable to 7.0.0 or later: composer update plank/laravel-mediable.
Which versions are affected?
| Package | Affected versions | Fixed in |
|---|---|---|
| plank/laravel-mediable (opens in a new tab) | < 7.0.0 | 7.0.0 |
What should you do?
Update every affected package you use to its fixed version, then check that nothing else in your project matches an advisory. To see which version you run, and whether anything is still affected:
composer show plank/laravel-mediable
composer auditAdvisory details
| Severity | HighCVSS 8.8 |
|---|---|
| Published | |
| Updated | |
| CVE | CVE-2026-49970 (opens in a new tab) |
| GHSA | GHSA-xv8g-76mx-2rxc (opens in a new tab) |
| Weakness | CWE-22 |
What the advisory says
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.
Source: GHSA-xv8g-76mx-2rxc (opens in a new tab) in the GitHub Advisory Database (CC BY 4.0). Data from GitHub (opens in a new tab) as of .