Grav path traversal in MediaUploadTrait::deleteFile

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

Grav is a flat-file CMS platform used to build and manage web content. A path traversal vulnerability in its media file deletion feature allows authenticated users with media management permissions to delete arbitrary files from the server, potentially compromising system configuration files and disrupting operations.

Technologies: Grav, getgrav/grav (Packagist). Vendors: Grav, Packagist.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
High severity, with a CVSS score of 8.1, published 25 August 2026.
Which products and versions are affected?
Grav < 2.0.16; getgrav/grav (Packagist) < 2.0.16.
Is there a fix for This vulnerability?
A patch was published on 2026-08-10: Version 2.0.16 includes the patch Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network, in a web application.
Am I affected?
Check whether you run Grav or 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.

Technical details

This is a path traversal vulnerability (CWE-22) in MediaUploadTrait::deleteFile() in system/src/Grav/Common/Media/Traits/MediaUploadTrait.php. The vulnerable code validates only the basename of the filename using Utils::checkFilename(), but fails to validate the directory path component, which may contain directory traversal sequences (../) that bypass the security check. An authenticated user with media management permissions can supply a filename like "../../config/system.yaml" to delete arbitrary files outside the intended media storage directory. The traversal path is reconstructed and passed unvalidated to unlink(), enabling file deletion outside the media folder. Grav versions before 2.0.16 are affected; version 2.0.16 and later include a patch.

Affected products

  • Grav Grav < 2.0.16

Timeline

  • 2026-08-10: disclosed
  • 2026-08-10: patched: Version 2.0.16 includes the patch

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.