GHSA-FWVH-RMX5-4J2W
Anonymous visitors can read pages protected in frontmatter.yaml after editors work through the API
Texto original en inglés · Ver en español
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-FWVH-RMX5-4J2W divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
When an editor works through the REST API (the API plugin that Admin2 uses), Grav can cache a page index that has dropped the `access` rules kept in folders' `frontmatter.yaml` files. Until that index is rebuilt, anonymous visitors can read members-only pages at their normal URLs. The pages are only exposed when their rule lives in `frontmatter.yaml` rather than in the page's own header, which is mostly done on multilingual sites. No configuration change is needed and the visitor sends nothing unusual.
Affected versions
Grav 2.x from 2.0.0 up to and including 2.2.17 with the API plugin installed. The scope-dependent header build in core is older (Grav 1.1.0), but a site is only exposed when an admin-type plugin that registers the admin context shares the site's page cache key, as the Grav 2 API plugin does. Grav 1.7 has the core code but no API plugin, and no affected 1.7 setup was found.
Details
`Page::header()` skips the `frontmatter.yaml` merge when it runs in the admin scope. `Pages::setPagesCacheId()` builds the same cache id for the admin scope and for the site, so whichever scope rebuilds the page index decides what the other one loads. The API plugin registers the admin context for authenticated requests without giving them their own cache key. Ordinary editing is therefore enough to poison the site's index: creating any page through the API, or reopening a page right after saving it before a visitor request arrives, rebuilds the index without the `frontmatter.yaml` rules. The page being edited does not have to be one of the protected ones, and the `frontmatter.yaml` files on disk stay unchanged throughout.
The exposure lasts until a site-scope request rebuilds the index, which can take up to `system.cache.lifetime` (seven days by default). The reproducer runs against the stock demo site and shows an anonymous `GET /members` switching from the login form to the members-only text after an editor patches and reopens the unrelated `/typography` page. The same mismatch applies to the lazy page index files and to rendered content caches, so the fix separates those as well. Publication state (`published: false`) following the same path is not treated as an access boundary by Grav and is not part of this advisory.
Impact
An anonymous visitor reads members-only page bodies that the operator protected with an access rule in `frontmatter.yaml`. The attacker cannot trigger or time the poisoning, since it depends on editor activity, and only rules stored in `frontmatter.yaml` are affected. The original report rated this Medium. It is rated High because the data is exposed to anyone with no account and no interaction, and the editor work that triggers it is routine.
Patches
Fixed in Grav 2.2.18. The page index id, the lazy index files and the rendered content cache keys are now partitioned by admin and site scope, so neither scope loads the other's cache.
Workarounds
Keep `access` rules in the page's own `.md` header rather than in `frontmatter.yaml`. After editing through the API, clear the cache so the site rebuilds its own index.
Credits
Discovered by Anthropic's OSS Scanner (ANT-2026-LM3R69G3).
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistgetgrav/grav |
Corregida | 2.2.18 | — | — |
2.2.18Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/getgrav/grav/security/advisories/GHSA-fwvh-rmx5-4j2wLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
