MediaUploadTrait::deleteFile() · Duplicate Advisory: Grav: Path Traversal
Affects getgrav/gravSource GCVE Database
CVSS 8.1 High · fixed in 2.0.16 : patch getgrav/grav soon.
Data as of 18 Sep 2026, 01:26 UTC
- Patch
- Available – fixed in 2.0.16
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:HWhat to do
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| Packagistgetgrav/grav | Affected– | Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A fix is available in Grav version 2.0.16 and later. Users should upgrade to version 2.0.16 or newer to remediate this vulnerability. No other mitigation guidance is provided in the advisory.
Description
Grav before version 2.0.16 has a path traversal vulnerability in the MediaUploadTrait::deleteFile() function. Authenticated users with media management permissions can exploit this flaw to delete arbitrary files by using directory traversal sequences in filenames. The vulnerability arises because the method only validates the basename of the filename but does not properly sanitize directory paths containing '../' sequences, which are passed to the unlink() function. This allows deletion of files outside the intended media storage directory.