Skip to main content

Grav CMS CVE-2026-42608

HIGH
Path Traversal (CWE-22)
2026-05-05 https://github.com/getgrav/grav GHSA-hmcx-ch82-3fv2
8.8
CVSS 4.0 · Vendor: https://github.com/getgrav/grav
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Send HTTP POST to form endpoint
  2. Delivery
    Inject traversal sequence in __form-flash-id parameter
  3. Exploit
    FormFlash resolves unsanitized path
  4. Execution
    Arbitrary directory created in user/config/
  5. Persist
    Write index.yaml with controlled YAML payload
  6. Impact
    Inject configuration directives or exhaust filesystem inodes

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires Grav CMS installation with at least one form-enabled page (contact form, login page, or registration page)-these ship by default in standard Grav installations and popular themes (e.g., Quark, Antimatter). The specific vulnerable component is the FormFlash class (Grav\Framework\Form\FormFlash) used for persisting form state across redirects. No authentication required (unauthenticated exploitation). No special webserver configuration needed beyond standard Grav deployment with writable directories for tmp://, user/config/, cache/, or logs/ (required for normal Grav operation). Attack succeeds against default configurations. Limiting factors: webserver filesystem permissions may restrict traversal to only certain writable paths (but user/config/ is typically writable for plugin/theme management), and some hosting environments use read-only filesystems for code directories (though tmp/ and cache/ usually remain writable). The vulnerability is present in both Apache and Nginx deployments.

Impact

This is a critical-priority vulnerability requiring immediate remediation. Authentication requirements: unauthenticated (inferred from description stating 'Unauthenticated Path Traversal' and 'Attack Requirements: None'-CVSS vector not provided but description confirms PR:N equivalent). Attack vector is network (AV:N inferred from remote POST-based exploitation). Attack complexity is low (AC:L)-the GitHub advisory shows deterministic exploitation via simple POST parameter manipulation with 100% reliability. Confirmed actively exploited (CISA KEV)-the description explicitly labels this a 'ZERO-DAY' with confirmed proof-of-concept filesystem writes. Publicly available exploit code exists (full PoC in advisory with before/after evidence). Real-world risk is elevated by three factors: (1) default-enabled attack surface (forms ship with standard Grav installations), (2) no authentication barrier, (3) confirmed weaponization. Impact extends beyond theoretical-configuration injection into user/config/ subdirectories can alter plugin/theme behavior, and recursive traversal enables DoS via disk/inode exhaustion. The fix in v2.0.0-beta.2 is a beta release, which may slow enterprise adoption. Organizations running Grav v1.7.x in production face immediate risk if forms are exposed. SSVC decision tree: exploitation=active, automatable=yes (simple POST), technical_impact=total (arbitrary file write in config paths). This maps to 'Act Now' priority despite absence of formal CVSS scoring.

Exploit ScenarioDerived

Attacker identifies a Grav CMS site with a publicly accessible contact form at /contact. Without authentication, they intercept the form submission POST request and modify the __form-flash-id parameter to ../../user/config/malicious_plugin. Upon submission, Grav's FormFlash component resolves the traversal sequence and creates /var/www/html/user/config/malicious_plugin/poc/index.yaml with attacker-controlled YAML content injected via form fields. The attacker repeats this process to inject configuration directives that enable a dormant plugin or modify theme rendering logic. Alternatively, they script recursive directory creation to exhaust available inodes, causing a filesystem denial-of-service that prevents legitimate writes. The GitHub advisory provides verbatim HTTP request examples and before/after filesystem state proving exploitation reliability.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 05, 2026

Unauthenticated path traversal in Grav CMS FormFlash component allows remote attackers to create arbitrary directories and write configuration files (index.yaml) with controlled content. Confirmed actively exploited (CISA KEV). The vulnerability affects all Grav v1.7.x installations with form-enabled pages (default in standard deployments). Attack complexity is low-requires only manipulating the __form-flash-id POST parameter with traversal sequences. Vendor-released patch available in v2.0.0-beta.2 (commit d904efc33) applies strict alphanumeric sanitization to session identifiers. EPSS exploitation probability data not available, but GitHub advisory confirms zero-day status prior to patch, with public proof-of-concept demonstrating directory creation in user/config/ paths leading to configuration injection and potential DoS via inode exhaustion.

RemediationAI

Upgrade to Grav CMS v2.0.0-beta.2 or later, which implements strict alphanumeric allowlist validation ([A-Za-z0-9,_-]{1,64}) on session_id, unique_id, and id parameters in FormFlash::__construct() before any path construction. Vendor patch commits: d904efc33e03ebb597afde8d3368b28cf0423632 (primary fix) and c66dfeb5ff679a1667678c6335eb9ff3255dfc47 (additional hardening). Full advisory and patch details at https://github.com/getgrav/grav/security/advisories/GHSA-hmcx-ch82-3fv2. If upgrading to beta release is not feasible for production environments, implement these compensating controls: (1) Set restrictive filesystem permissions on user/config/, cache/, logs/, and tmp/ directories to prevent webserver process (www-data) from creating new subdirectories (chmod 550 with read-only for www-data group; note this may break legitimate cache writes-test thoroughly). (2) Deploy web application firewall rules to block POST requests containing __form-flash-id parameters with ../ or encoded traversal sequences (%2e%2e%2f). (3) Temporarily disable form functionality on internet-facing pages if business operations allow. Trade-off: permission hardening may require manual cache clearing; WAF rules risk false positives on legitimate session IDs containing hyphens.

Affected Packages

composer getgrav/grav fix: 2.0.0-beta.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in composer

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability resides in Grav's FormFlash component (Grav\Framework\Form\FormFlash class), which persists form data across HTTP redirects using filesystem-backed temporary storage. The class constructs storage paths by concatenating a base directory with an unsanitized session_id value received from the __form-flash-id POST parameter. The path construction logic passes this user-controlled identifier directly to findResource() without validating or escaping directory traversal sequences (../) before stream resolution. This is a classic CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) implementation flaw. The stream locator resolves tmp://forms/ prefixes to writable webserver directories (user/config/, cache/, logs/, tmp/), enabling attackers to escape intended boundaries. The FormFlash component is core to Grav's form handling-used by contact forms, login pages, and registration workflows-making it present in default installations. The CPE pkg:composer/getgrav_grav confirms this is a first-party Grav CMS core vulnerability, not a third-party plugin issue.

Know when PHP gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/getgrav/grav) PRIMARY 8.8 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:P

Primary rating from Vendor (https://github.com/getgrav/grav) · only source for this CVE.

CVSS VectorVendor: https://github.com/getgrav/grav

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
CVSS changed
May 11, 2026 - 16:22 NVD
8.8 (HIGH)

DescriptionCVE.org

Vulnerability Report: Grav CMS Unauthenticated Path Traversal & Arbitrary File Write

[ZERO-DAY] Unauthenticated Path Traversal leading to Arbitrary Directory Creation and Configuration Injection

Summary

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.

Affected Component

  • 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)

Vulnerability Details

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:

php
$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/).

Affected Versions & Zero-Day Status

  • 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.

Steps to Reproduce

  1. Identify any page containing a Grav Form (e.g., /contact).
  2. Intercept the POST request during form submission.
  3. Modify the __form-flash-id parameter to include a traversal sequence targeting a writable directory (e.g., ../../user/config/proof_dir).
  4. Submit the request.
  5. Observe that a new directory (poc/) and file (index.yaml) have been created at the traversed path.

Request Example

http
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]=Payload

Response / Result

  • HTTP/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

Proof of Concept Evidence (Before/After)

Before Exploitation

  • Status: Directory does not exist.
  • Evidence:
bash
$ ls -la /var/www/html/user/config/proof_dir/
ls: cannot access '/var/www/html/user/config/proof_dir/': No such file or directory

After Exploitation

  • Status: Arbitrary directory and index.yaml created.
  • Evidence:
bash
$ 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: confirmed

Impact

  • Clarified 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).

Attack Requirements

  • Authentication: None (Unauthenticated)
  • Configuration: Standard Grav installation with at least one form-enabled page (e.g., Contact, Login, Registration)

Exploitability Assessment

  • 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.

Remediation

  1. Sanitize Session IDs: Apply basename() or a strict alphanumeric regex to the session_id in FormFlash before path construction.
  2. Filesystem Hardening: Ensure user/config/ and other sensitive directories have restrictive permissions preventing the webserver from creating new subdirectories.
  3. Update Grav: Monitor for patches addressing FormFlash sanitization.

---

Maintainer note - fix applied (2026-04-24)

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:

Executive ViewAI

Why It Matters

Grav CMS versions 1.7.x are vulnerable to unauthenticated remote path traversal in the FormFlash component, enabling attackers to create arbitrary directories and inject malicious configuration files, with active exploitation confirmed by CISA. All standard Grav deployments with form-enabled pages are at immediate risk of configuration compromise and potential denial of service. Organizations running affected versions should treat this as a critical priority requiring immediate patching to prevent unauthorized system modification.

Business Impact: Severe
Compensating Controls

Apply vendor patch. If immediate patching is delayed: (1) Disable all form functionality at the application level; (2) Implement network-level access controls restricting POST requests to form endpoints by IP whitelist; (3) Enable filesystem integrity monitoring on user/config/ directory to alert on unauthorized file creation; (4) Isolate affected systems from production traffic pending patch deployment.

Threat Intelligence Overview

EPSS Score
0.1%
Top 73% exploitable
Threat Intel
1
1 sources
Exploit
POC
Public exploit code exists
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Out-of-Cycle
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
Very High

Priority Score

64
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Affected Products (CPE)CVE.org

pkg:composer/getgrav_grav

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy