GHSA-QRP6-34RP-Q6MR
Publishers can read account and configuration files through YAML parsing in Twig content
Texto original en inglés · Ver en español
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-QRP6-34RP-Q6MR divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
A page editor (publisher) can read account and configuration files by passing a crafted one-line string to Twig's `yaml_decode` in page content. Grav's YAML compatibility fallback treats a one-line string as a file name when such a file exists, opens it as a stream path, and prints its content, so `account://admin.yaml` (password hash, reset token) and other YAML configuration reach anonymous visitors.
Affected versions
Grav 2.x from 2.0.0 up to and including 2.2.17. The compatibility fallback has been reachable from `yaml_decode` since Grav 1.5.1, and it became a sandbox escape when the Twig sandbox arrived in 2.0.0-beta.2. Grav 1.7 has the same fallback, but exploiting it there needs a publisher account or a site-built form with a `yaml: true` field, so no 1.7 release is part of this advisory.
Details
When the Symfony YAML parser throws, `YamlFormatter` falls back to the toolbox's `Compat\Yaml\Yaml::parse()`. That static method treats a one-line string as a file name when `is_file()` succeeds. Grav forces the compatibility mode on regardless of `system.strict_mode.yaml_compat`. A value such as `account://x/y: @z/../../admin.yaml` makes Symfony throw (because of the `@`), and the stream normalizer then folds the `..` textually, so the fallback opens `account://admin.yaml`. `yaml_decode` is on the sandbox allowlist, so page content can call it. The reproducer shows a visitor receiving the exact admin hash in the rendered page.
The same fallback is reachable through form fields with `yaml: true` validation (anonymous, but only on a site that built such a form and echoes the value), one-line page frontmatter decoded by the toolbox's `MarkdownFile`, the Flex `frontmatter()` formatter, and the YAML linter in strict mode.
Impact
A publisher reads any YAML file in a resolvable stream, which includes account files and saved plugin configuration. The password hash and reset token let the publisher take over accounts. The attacker needs page edit rights.
Patches
Fixed in Grav 2.2.18. Core's YAML formatter and YAML linter call the compatibility parser directly instead of the static `Compat\Yaml\Yaml::parse()` that guesses file names, so a one-line string is always read as YAML text, and one-line page frontmatter is passed to the toolbox decoder with a blank line after it so it is also read as text. A change inside the `rockettheme/toolbox` library itself (its `MarkdownFile` and `YamlFile` classes) is not part of this release.
Credits
Discovered by Anthropic's OSS Scanner (ANT-2026-Z8GAVL6B).
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
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-qrp6-34rp-q6mrLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
