CVE-2024-34082
JSON

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 packageVersionsReported by
getgrav grav< 1.7.46, *, before 1.7.46CVE List, NVD
getgrav/grav (Packagist)before 1.7.46GitHub Advisory Database

All scores

GitHub_M8.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:L
GitHub8.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:L
NVD9.9critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Classification

CWE-22CWE-269

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.

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.

file-read-2-ATO

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') }}

file-read-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

SourceRecordLicence
CVE ListCVE-2024-34082 changed 2024-08-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-f8v5-jmfh-pr69 changed 2026-09-10CC-BY-4.0
NVDCVE-2024-34082 changed 2026-06-17Public domain