5- Extract Backup :
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| getgrav/grav | composer | < 1.8.0-beta.27 | 1.8.0-beta.27 |
The analysis of the provided security advisory and the associated commit ed640a13143c4177af013cf001969ed2c5e197ee clearly points to a path traversal vulnerability within the backup functionality of Grav CMS. The vulnerability, identified as GHSA-j422-qmxp-hv94, is located in the system/src/Grav/Common/Backup/Backups.php file. The backup static method in the Grav\Common\Backup\Backups class was identified as the vulnerable function. The patch evidence shows the addition of security measures, specifically the use of realpath() to resolve the absolute path and a check against a list of forbidden system directories ($blockedPaths). Before this fix, the user-supplied path for the backup's 'Root Folder' was used without sufficient validation, allowing an administrator to traverse the filesystem and include sensitive files in the backup archive. The Proof of Concept confirms this by demonstrating how to read the /root/.ssh/id_rsa file. Therefore, the Grav\Common\Backup\Backups::backup function is the precise location of the vulnerability.
Grav\Common\Backup\Backups::backupsystem/src/Grav/Common/Backup/Backups.php