# CVE-2026-72695: Grav path traversal in MediaUploadTrait::deleteFile()

Source: https://junglewise.ai/threats/cve-2026-72695-grav-path-traversal-in-mediauploadtrait-deletefile  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-25. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-72695 · Severity: high · CVSS 8.1 · Published 2026-08-25

Grav CMS's media management system contains a flaw that allows authenticated users with media editing permissions to delete files anywhere on the server, not just intended media uploads. By crafting requests with directory-escape sequences in filenames, an attacker could delete critical configuration files, user accounts, or other pages' content, causing data loss and potentially disabling the application.

Technologies: [getgrav/grav (Packagist)](https://junglewise.ai/threats/technologies/getgrav-grav). Vendors: [Packagist](https://junglewise.ai/threats/vendors/packagist).

## Quick answers

**Is CVE-2026-72695 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-72695 being exploited in the wild.

**How severe is CVE-2026-72695?** High severity, with a CVSS score of 8.1, published 25 August 2026.

**Which products and versions are affected?** getgrav/grav (Packagist) <= 2.0.15, ECOSYSTEM:introduced=0,fixed=2.0.16.

**Is there a fix for CVE-2026-72695?** Yes. getgrav/grav (Packagist): upgrade to 2.0.16 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-72695 attacked?** It is attacked over the network.

**Am I affected by CVE-2026-72695?** Check whether you run getgrav/grav (Packagist) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- getgrav/grav (Packagist): upgrade to 2.0.16 or later

  ```sh
  composer require getgrav/grav:^2.0.16
  ```


## Technical details

The vulnerability is a path traversal (CWE-22) in the `deleteFile()` method of MediaUploadTrait. The method validates only the filename basename using `Utils::checkFilename()`, allowing directory path components containing `../` sequences to bypass validation and be passed unescaped to `unlink()`. An authenticated user with page/media editing permissions can exploit this through the Flex media handling pipeline by submitting form data with traversal sequences in the media deletion keys. The attacker can escape the intended `user/pages/` media directory to delete arbitrary files. Fix: apply `checkFilename()` validation to the full filename parameter before path decomposition.

## Affected products

- Grav Grav CMS 2.0.16 and earlier

## Identifiers

- CVE-2026-72695
- GHSA-jq29-c7v8-rg55

## Timeline

- 2026-09-17: disclosed
- 2026-09-17: advisory: GHSA-jq29-c7v8-rg55

## Related threats

- [Grav cross-site scripting in Twig sandbox asset methods](https://junglewise.ai/threats/cve-2026-86197-grav-cross-site-scripting-in-twig-sandbox-asset-methods)
- [Grav Twig sandbox config exfiltration via offsetGet and dump filters](https://junglewise.ai/threats/cve-2026-61842-grav-twig-sandbox-config-exfiltration-via-offsetget-and-dump)
- [Grav ZipArchiver decompression bomb via missing extraction limits](https://junglewise.ai/threats/cve-2026-61690-grav-ziparchiver-decompression-bomb-via-missing-extraction-limits)
- [Grav incomplete Twig sandbox denylist information disclosure](https://junglewise.ai/threats/grav-incomplete-twig-sandbox-denylist-information-disclosure-e903bd3b)
- [Grav UserInterface offsetGet/offsetExists Twig sandbox bypass](https://junglewise.ai/threats/grav-userinterface-offsetget-offsetexists-twig-sandbox-bypass-f709468e)
