Skip to content

Grav vulnerable to Path Traversal allowing server files backup

Moderate severity GitHub Reviewed Published Dec 1, 2025 in getgrav/grav • Updated Dec 2, 2025

Package

composer getgrav/grav (Composer)

Affected versions

< 1.8.0-beta.27

Patched versions

1.8.0-beta.27

Description

Summary

A path traversal vulnerability has been identified in Grav CMS, versions 1.7.49.5 , allowing authenticated attackers
 with administrative privileges to read arbitrary files on the underlying server filesystem. This vulnerability arises due
 to insufficient input sanitization in the backup tool, where user-supplied paths are not properly restricted, enabling
 access to files outside the intended webroot directory. The impact of this vulnerability depends on the privileges of 
the user account running the application.

PoC

To accurately demonstrate the maximum potential impact of this vulnerability, the testing environment was configured in a specific way:

- Elevated Privileges: The application was run locally with the highest possible system privileges, operating under the **`root`** user account.
    
- Objective: This configuration was chosen to unequivocally show that the path traversal vulnerability is not just a theoretical issue but can lead to a complete compromise of the underlying host when combined with poor operational practices. The ability to read any file on the system is the ultimate test of the flaw's severity.
    

Proof of Concept Goal: Under these conditions, the subsequent PoC will exploit the vulnerability to read the SSH private key
 of the `root` user (`/root/.ssh/id_rsa`). The successful exfiltration of this key represents a worst-case scenario, as it would provide 
an attacker with persistent, undetectable, and complete administrative access to the host server. This highlights the critical intersection
 of an application-layer vulnerability and a infrastructure-level misconfiguration.

1- LOGIN AS ADMIN AND  GO TO  : http://127.0.0.1/admin/tools/backups
2- Change 'Root Folder' to backup directory /../../../../../../../root/.ssh/ 

Screenshot 2025-09-11 161519

3- CLICK  : 'SAVE'
4- CLICK  : 'Backup Now'

Screenshot 2025-09-11 154151

5- Extract Backup :

Screenshot 2025-09-11 160114

Screenshot 2025-09-11 160135

### References - https://github.com/getgrav/grav/security/advisories/GHSA-j422-qmxp-hv94 - https://nvd.nist.gov/vuln/detail/CVE-2025-66302 - https://github.com/getgrav/grav/commit/ed640a13143c4177af013cf001969ed2c5e197ee
@rhukster rhukster published to getgrav/grav Dec 1, 2025
Published by the National Vulnerability Database Dec 1, 2025
Published to the GitHub Advisory Database Dec 2, 2025
Reviewed Dec 2, 2025
Last updated Dec 2, 2025

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
High
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N

EPSS score

Weaknesses

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

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. Learn more on MITRE.

CVE ID

CVE-2025-66302

GHSA ID

GHSA-j422-qmxp-hv94

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.