llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Packagist · getgrav/grav

GHSA-GJX7-95HG-X969

Anonymous visitor can create a super-admin account on installs whose path contains brackets

Texto original en inglés · Ver en español

Parche disponible
Descargar PNG JSON
CVSS
—
high
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche2 versiones1.7.53.7 · 2.2.18
Exposición21 dDesde la divulgación, 31 oct 2026, 4:05 p. m.
Detección18 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de la severidad declarada por GHSA (alta) y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico parcial. Hay versiones corregidas disponibles.
Revisa si tu versión cae en el rango. Te espero.Seguimiento de cerca: yo sé de mirar de cerca.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
31 oct 26
18 nov 26
21 nov 26
31 oct 26
6 nov 26
11 nov 26
16 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-GJX7-95HG-X969 divulgada
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Summary

On a Grav install whose path contains a folder name with a bracket pair, such as `/var/www/grav[staging]`, an anonymous visitor can create a super-admin account with a single request to the API plugin's first-run setup endpoint, or overwrite the existing `admin` account. The cause is that core's account counter always returns zero on such a path, so the setup endpoint believes no accounts exist. Apart from the folder name, which the operator chooses and the attacker cannot influence, everything involved is the default configuration.

Affected versions

Grav 2.x from 2.0.0 up to and including 2.2.17, and Grav 1.7 up to and including 1.7.53.6. The pattern dates from 2019 (first released in 1.6.9). Only installs with a `[...]` pair, or a backslash, somewhere in the absolute path of the install are exposed. Stock paths such as `/var/www/html`, `public_html` and `httpdocs` are not.

Details

`UserCollection::count()` counts accounts with a `glob()` over the absolute accounts folder, and that path is not escaped. PHP reads `[staging]` as a character class, so the pattern never matches the real folder and the count is zero however many account files exist. Logins and account lookups do not use patterns and keep working, so the operator sees nothing unusual.

The API plugin's `POST /api/v1/auth/setup` is allowed without credentials while no accounts exist, and it decides that through this counter. It then loads the requested username, which returns the existing account if there is one. With the same request, an install under `/var/www/grav-staging` answers 409, while `/var/www/grav[staging]` answers 200 and returns access and refresh tokens for a new `intruder` account with `super_admin: true`. The setup endpoint never closes on an affected install, and `GET /api/v1/auth/setup` tells anyone that setup is required. Only the bracket case was reproduced against a served site. A backslash in a folder name also gives zero at the `glob()` level.

On Grav 1.7 with the classic admin plugin, the same counter gates the anonymous first-admin registration form, so those sites are exposed through that form instead of the API.

Impact

The visitor is anonymous and the result is a super-admin account, or the existing administrator's account under a password the visitor chose. Because the operator picks the folder name and the attacker cannot bring the condition about, and because very few installs meet it, this is rated High rather than Critical.

Patches

Fixed in Grav 2.2.18 and 1.7.53.7. The account counter now lists the accounts folder with `scandir()` and the same file filter the account lookup uses, instead of a `glob()` pattern, so a path with brackets or a backslash no longer reads as zero accounts. On Grav 2 sites, update the API plugin to 1.1.6 as well: first-run setup now answers 409 for a username that already exists, so even a wrong account count can no longer replace an account.

Workarounds

Move the install to a path without `[`, `]` or backslash characters, or block `POST /api/v1/auth/setup` at the web server once the first account exists.

Credits

Discovered by Anthropic's OSS Scanner (ANT-2026-W7PWSBH5).

Versiones

Rangos afectados

Afectada Corregida
getgrav/grav< 1.7.53.7
getgrav/grav≥ 2.0.0 < 2.2.18
1.7.53.7
2.0.0
2.2.18
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
Packagistgetgrav/grav
Corregida 1.7.53.7, 2.2.18 — —
Versiones corregidas1.7.53.72.2.18
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/getgrav/grav/security/advisories/GHSA-gjx7-95hg-x969

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.