Laravel-Mediable
CVE-2026-49970
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate to upload feature
-
DeliverySubmit upload with '../' directory argument
-
ExploitBypass sanitizePath regex/trim
-
ExecutionWrite PHP file to web root
-
PersistRequest planted file
-
ImpactExecute arbitrary code
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK
2 techniques across 2 tactics: Discovery, Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that the host Laravel application allows the attacker to influence the directory argument passed to MediaUploader::toDestination() - the specific vulnerable sink - while running a Laravel-Mediable version before 7.0.0. The attacker must have at least low-level privileges (PR:L) sufficient to reach an upload workflow, and needs a writable, web-accessible or config-sensitive target path for the file write to yield code execution. What limits exploitation: applications that hardcode destination directories or sanitize path input before calling the uploader are not exploitable, the process must have write permission to a sensitive location (document root, .env, or config directory), and the account must be able to invoke the upload feature; there is no user-interaction requirement (UI:N), so any qualifying authenticated request suffices. |
| Impact | The CVSS 4.0 base score is 8.7 (AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H), indicating a network-reachable, low-complexity attack that requires some privilege (PR:L) and no user interaction, with high confidentiality, integrity, and availability impact - consistent with arbitrary file write escalating to RCE. There is no EPSS score, KEV listing, or public PoC in the provided data, so exploitation is not confirmed in the wild; the RCE and Path Traversal tags plus VulnCheck attribution reflect assessed potential, not observed attacks. A meaningful caveat: the PR:L rating and the description's framing ('by controlling the directory argument passed to MediaUploader::toDestination()') imply the attacker must be able to influence the destination directory - realistic only in applications that pass user-controlled input into that argument, so real-world risk depends heavily on how the host application wires up the uploader rather than on the library alone. Given a confirmed patch and RCE potential, this is a genuine priority for any Laravel app using this package with user-influenced upload paths, but the absence of EPSS/KEV suggests it is not yet mass-exploited. |
| Exploit ScenarioDerived | In a Laravel app that lets users pick or supply an upload destination folder, an attacker submits an upload whose directory argument contains '../' sequences (e.g. traversing to the public web root) and writes a .php file, then requests that file to execute arbitrary code. Because the attack is network-based with low complexity and no user interaction, it can be automated once the vulnerable upload endpoint is identified. No public PoC is referenced, but the arbitrary-file-write-to-RCE pattern is well understood. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 13, 2026
Arbitrary file write in the Plank Laravel-Mediable package (before 7.0.0) lets an attacker who influences the destination directory of MediaUploader::toDestination() plant uploaded files outside the intended storage path, culminating in remote code execution. The flaw stems from a weak File::sanitizePath() regex that permits both '.' and '/' characters plus an ineffective trailing trim(), so '../' traversal sequences survive sanitization and files can land in the document root, .env, or config directories. No public exploit has been identified at time of analysis, but a vendor patch (7.0.0) exists and the issue was reported by VulnCheck.
RemediationAI
Vendor-released patch: 7.0.0 - upgrade the plank/laravel-mediable dependency to 7.0.0 or later (composer require plank/laravel-mediable:^7.0), which strips '.' characters from path segments in directory validation and closes the traversal (fix commit 6d1e7fb39922fdfb3b2d120e13f4eb2e653ae082, release notes at https://github.com/plank/laravel-mediable/releases/tag/7.0.0). Where an immediate upgrade is not possible, the effective compensating control is to stop passing user-controlled input into the directory argument of MediaUploader::toDestination(): hardcode or server-side-map destination directories, and reject any directory value containing '.', '/', or '\' before it reaches the uploader - the trade-off is loss of any legitimate feature that lets users choose upload subfolders. Additionally, run the PHP/web-server process under a least-privileged user without write access to the document root, .env, or config directories so a residual traversal cannot land executable or config files. Note that 7.0.0 is a broader security release also addressing SSRF (CVE-2026-49969) and SVG stored XSS (CVE-2026-49971), so upgrading is preferable to point mitigations.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in composer
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Laravel-Mediable is a PHP/Composer library (cpe:2.3:a:plank:laravel-mediable) that adds polymorphic media attachment and file-upload handling to Laravel applications. The vulnerability is a classic CWE-22 Improper Limitation of a Pathname to a Restricted Directory: the File::sanitizePath() helper used by MediaUploader::toDestination() relies on a permissive character-class regex that whitelists dot and slash characters and then only trims trailing separators, rather than canonicalizing the path or stripping interior '.' segments. Because the directory argument is treated as attacker-influenceable, traversal tokens such as '../' pass through, allowing writes anywhere the PHP process has permission. The 7.0.0 fix changes directory validation to strip '.' characters from each path segment, neutralizing '../' patterns.
Know when Laravel Mediable gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Network-reachable low-complexity upload sink requires an authenticated actor able to influence the directory argument (PR:L), and arbitrary file write to RCE yields full C/I/A impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
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.
Executive ViewAI
CVE-2026-49970 is a remote code execution vulnerability in Plank Laravel-Mediable versions before 7.0.0 that enables arbitrary file write through path traversal, allowing attackers to plant code in web-accessible directories. Organizations using this open-source package face direct server compromise risk and potential data exfiltration. Immediate patching to version 7.0.0 is required to prevent application takeover and lateral network movement.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Affected Products (CPE)CVE.org
More in Laravel Mediable
View allUnauthenticated file upload in Laravel-Mediable 7.0.0 and 7.0.1 lets a remote attacker upload a .pht file that passes Me
Remote code execution in the plank/laravel-mediable package before 7.0.0 lets attackers upload a double-extension file s
Server-side request forgery in Laravel-Mediable before 7.0.0 enables network-accessible, low-privilege attackers to issu
Stored XSS in Laravel-Mediable before 7.0.0 allows network-accessible, unauthenticated attackers to persist malicious Ja
GHSA-xv8g-76mx-2rxc
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB