8.5high
Grav Arbitrary File Read to Account Takeover
- Severity
- 8.5high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.95% (higher than 60% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-f8v5-jmfh-pr69
Description
Grav is a file-based Web platform. Prior to version 1.7.46, a low privilege user account with page edit privilege can read any server files using Twig Syntax. This includes Grav user account files - `/grav/user/accounts/*.yaml`. This file stores hashed user password, 2FA secret, and the password reset token. This can allow an adversary to compromise any registered account and read any file in the web server by resetting a password for a user to get access to the password reset token from the file or by cracking the hashed password. A low privileged user may also perform a full account takeover of other registered users including Administrators. Version 1.7.46 contains a patch.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| getgrav grav | < 1.7.46, *, before 1.7.46 | CVE List, NVD |
| getgrav/grav (Packagist) | before 1.7.46 | GitHub Advisory Database |
All scores
| GitHub_M | 8.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:L |
| GitHub | 8.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:L |
| NVD | 9.9critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H |
Classification
What each source says
CVE List
Grav is a file-based Web platform. Prior to version 1.7.46, a low privilege user account with page edit privilege can read any server files using Twig Syntax. This includes Grav user account files - `/grav/user/accounts/*.yaml`. This file stores hashed user password, 2FA secret, and the password reset token. This can allow an adversary to compromise any registered account and read any file in the web server by resetting a password for a user to get access to the password reset token from the file or by cracking the hashed password. A low privileged user may also perform a full account takeover of other registered users including Administrators. Version 1.7.46 contains a patch.
GitHub Advisory Database
Summary
A low privilege user account with page edit privilege can read any server files using Twig Syntax. This includes Grav user account files - /grav/user/accounts/*.yaml. This file stores hashed user password, 2FA secret, and the password reset token. This can allow an adversary to compromise any registered account by resetting a password for a user to get access to the password reset token from the file or by cracking the hashed password.
Proof Of Concept
{{ read_file('/var/www/html/grav/user/accounts/riri.yaml') }}
Use the above Twig template syntax in a page and observe that the administrator riri's authentication details are exposed accessible by any unauthenticated user.
As an additional proof of concept for reading system files, observe the /etc/passwd file read using the following Twig syntax:
{{ read_file('/etc/passwd') }}
Impact
This can allow a low privileged user to perform a full account takeover of other registered users including Adminsitrators. This can also allow an adversary to read any file in the web server.
NVD (es)
Grav es una plataforma web basada en archivos. Antes de la versión 1.7.46, una cuenta de usuario con privilegios bajos y privilegios de edición de página podía leer cualquier archivo del servidor usando Twig Syntax. Esto incluye archivos de cuentas de usuario de Grav: `/grav/user/accounts/*.yaml`. Este archivo almacena la contraseña de usuario con hash, el secreto 2FA y el token de restablecimiento de contraseña. Esto puede permitir que un adversario comprometa cualquier cuenta registrada y lea cualquier archivo en el servidor web restableciendo una contraseña para que un usuario obtenga acceso al token de restablecimiento de contraseña desde el archivo o descifrando la contraseña hash. Un usuario con pocos privilegios también puede realizar una apropiación completa de la cuenta de otros usuarios registrados, incluidos los administradores. La versión 1.7.46 contiene un parche.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-34082 changed 2024-08-02 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-f8v5-jmfh-pr69 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2024-34082 changed 2026-06-17 | Public domain |