Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-42608 — grav

🔴 CVSS 9.1 — Critical ✅ No Known Exploit CWE-22 NVD
9.1
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Grav has Unauthenticated Path Traversal & Arbitrary File Write in its FormFlash component

# 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. Sanit

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity high, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Unchanged — the damage stays inside the vulnerable component.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: None.

Weakness class

CVE-2026-42608 is classified as CWE-22: Path Traversal. A file path built from user input is not confined to the intended directory, letting an attacker reach files elsewhere on the filesystem.

Affected software

CVE-2026-42608 is recorded against 2 packages.

  • getgrav/grav (fixed in 2.0.0-beta.2)
  • grav

Timeline and source

Published on 5 May 2026 and last revised on 13 May 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Web)
github.com (Web)
github.com (Package)

Other advisories for this package

getgrav/grav has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-22: Path Traversal) in other software:

Details

Severity HIGH
CVSS Score 9.1
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
CWE CWE-22
Public Exploit ✅ No
Source NVD
Published 2026-05-05
Updated 2026-08-20
Modified 2026-05-13
Fix URL N/A

Affected Packages

Software From version Fixed in
getgrav/grav — 2.0.0-beta.2
grav — —

Similar Threats

Exploit Protection

Are you running grav?

CVE-2026-42608 carries CVSS 9.1 Critical rating. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2026-42608 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026
✓