Description
Grav CMS before 2.0.16 contains a path traversal vulnerability in the media_directory() Twig function that fails to validate filesystem paths, allowing authenticated users to enumerate and access files outside intended scope. Attackers with page authoring privileges can supply arbitrary filesystem paths to media_directory() and use the allow-listed filepath accessor on Medium objects to read file contents of any file matching configured media extensions that the web server process can access.
Published: 2026-08-25
Score: 7.1 High
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Grav CMS before version 2.0.16 contains a path traversal flaw in the media_directory Twig function. The function fails to validate file system paths, enabling authenticated users with page‑authoring rights to supply arbitrary paths and have the system read any file whose extension matches the configured media types that the web‑server process can access. This permits exploitation to expose sensitive system files, configuration files, or other data stored outside the intended media directory. The weakness is a classic path traversal (CWE‑22).

Affected Systems

All installations of Grav CMS with a version earlier than 2.0.16 are vulnerable. The affected product is Grav CMS (getgrav:grav). The flaw stems from the media_directory Twig function used in page rendering. The vulnerability is present in all versions prior to 2.0.16; users running 2.0.16 or newer are not affected.

Risk and Exploitability

The CVSS score of 7.1 indicates a medium to high risk. The EPSS score is not available, so the likelihood of present exploitation cannot be quantified. The flaw requires the attacker to have authenticated access with page‑authoring privileges, which are typically granted to content editors. Once those privileges are obtained, the attacker can enumerate and read any media‑type files accessible by the web server. The vulnerability is listed as not in the CISA KEV catalog, but the impact on confidentiality can be significant. Inferences about the attack vector note that the code path is triggered by an authenticated request containing a custom path, suggesting that an attacker would likely use the Grav admin interface or craft a request to the Twig media_directory function to reference arbitrary files.

Generated by OpenCVE AI on August 25, 2026 at 03:23 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Grav CMS to version 2.0.16 or later.
  • If an upgrade is not possible immediately, configure Grav to restrict the media extensions to a minimal set and remove any potentially sensitive extensions; this reduces the attack surface for the traversal flaw.
  • Limit page authoring privileges to trusted users only or remove the page authoring role from users who do not need it.

Generated by OpenCVE AI on August 25, 2026 at 03:23 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 25 Aug 2026 02:00:00 +0000

Type Values Removed Values Added
Description Grav CMS before 2.0.16 contains a path traversal vulnerability in the media_directory() Twig function that fails to validate filesystem paths, allowing authenticated users to enumerate and access files outside intended scope. Attackers with page authoring privileges can supply arbitrary filesystem paths to media_directory() and use the allow-listed filepath accessor on Medium objects to read file contents of any file matching configured media extensions that the web server process can access.
Title Grav CMS before 2.0.16 Path Traversal via media_directory
First Time appeared Getgrav
Getgrav grav
Weaknesses CWE-22
CPEs cpe:2.3:a:getgrav:grav:*:*:*:*:*:*:*:*
Vendors & Products Getgrav
Getgrav grav
References
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N'}

cvssV4_0

{'score': 7.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-25T01:30:18.001Z

Reserved: 2026-08-10T13:02:20.829Z

Link: CVE-2026-72697

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-25T02:16:45.407

Modified: 2026-08-25T02:16:45.407

Link: CVE-2026-72697

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-25T03:30:05Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')