# Grav: Path Traversal in MediaUploadTrait::deleteFile() Allows Arbitrary File Deletion

High severity, published 2026-09-17. Update getgrav/grav to 2.0.16 or later: composer update getgrav/grav.

Canonical URL: https://buzzphp.com/security/ghsa-jq29-c7v8-rg55 · Data from GitHub as of 2026-11-25.

| | |
| --- | --- |
| Severity | high (CVSS 8.1) |
| Published | 2026-09-17 |
| Updated | 2026-09-17 |
| CVE | [CVE-2026-72695](https://nvd.nist.gov/vuln/detail/CVE-2026-72695) |
| GHSA | [GHSA-jq29-c7v8-rg55](https://github.com/advisories/GHSA-jq29-c7v8-rg55) |
| Weakness | CWE-22 |

| Package | Affected versions | Fixed in |
| --- | --- | --- |
| getgrav/grav | <= 2.0.15 | 2.0.16 |

## What to do

Update getgrav/grav to 2.0.16 or later: composer update getgrav/grav.

Check which version you run with `composer show getgrav/grav`, and every affected package with `composer audit`.

## About this advisory

Path Traversal in MediaUploadTrait::deleteFile() Allows Arbitrary File Deletion

Summary

A path traversal vulnerability in MediaUploadTrait::deleteFile() allows an authenticated user with media management permissions to delete arbitrary files on the server. The method validates only the basename portion of the filename using Utils::checkFilename(), while the directory path (which may contain ../ sequences) is preserved and passed unvalidated to unlink(). This enables directory escape from the intended media storage path.

Severity

High (8.1) - CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H

CWE

CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Details



## Links

- [GHSA-jq29-c7v8-rg55 on GitHub](https://github.com/advisories/GHSA-jq29-c7v8-rg55)
- [CVE-2026-72695 on the National Vulnerability Database](https://nvd.nist.gov/vuln/detail/CVE-2026-72695)
- [All Composer security advisories](https://buzzphp.com/security)
