CVE-2026-72697: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in getgrav grav
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.
CVSS v4.0
Score 7.1high
Affected software
getgrav
grav
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The media_directory() Twig function in Grav CMS (getgrav/grav) is allow-listed for sandboxed page content but improperly validates its input. When given a plain filesystem path (not a Grav stream), it bypasses containment checks and passes the raw path to the Media constructor, which enumerates files with configured media extensions in that directory. The sandbox allow-list erroneously permits the Medium class's 'filepath' accessor, exposing absolute file paths and enabling reading of file contents. This combination allows an attacker who can inject Twig-processed page content to list and read arbitrary files accessible to the web server. The vulnerability is confirmed in Grav CMS version 2.0.15 and earlier, fixed in 2.0.16.
Potential Impact
An attacker with the ability to inject Twig-processed page content can enumerate and read files with certain media extensions anywhere on the filesystem that the web server process can access. This can lead to unauthorized disclosure of sensitive files such as configuration files, documents, and other data matching the media types recognized by Grav. The vulnerability does not require user interaction and does not involve privilege escalation beyond the web server's permissions.
Mitigation Recommendations
A fix is available in Grav CMS version 2.0.16 that addresses this issue. Users should upgrade to version 2.0.16 or later. Until upgraded, avoid allowing untrusted users to inject Twig-processed content or use sandboxed functions that expose filesystem paths. Review and restrict sandbox allow-lists to ensure that sensitive methods like 'filepath' are not accessible.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-08-10T13:02:20.829Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a8cf57aacd9273b4984287b
Added to database: 08/25/2026, 01:52:58 UTC
Last enriched: 09/18/2026, 01:27:30 UTC
Last updated: 10/08/2026, 18:48:48 UTC
Views: 48
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.