GHSA-86M3-293G-FMP6
Page-authored Flex form overrides let page editors run PHP and user managers become super admin
Texto original en inglés · Ver en español
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-86M3-293G-FMP6 divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Grav lets a page define a front-end Flex form and override the form's fields in the page frontmatter. Three separate flaws in how those overrides are merged into the object's blueprint let low-privileged accounts exceed their role. Two let a page editor (publisher) call any public static PHP method, which gives PHP execution as the web server user. The third lets a user manager who holds `admin.users.update` give their own account super-admin rights. This is the next round after GHSA-9rq7-4cch-f22j and GHSA-47gg-mh38-9rr7, which closed earlier spellings of the same trust problem.
Affected versions
Grav 2.x from 2.0.0 up to and including 2.2.17. The two callable-allowlist bypasses exist from Grav 2.0.15, when blueprint trust by provenance was introduced. The field override leak into the object's cached blueprint dates from Grav 1.7.4, so the user manager path also exists on 1.7. It needs an account with delegated user management, so no 1.7 release is part of this advisory.
Details
All three enter at the same place: `FlexForm::getBlueprint()` merges a page-authored override into the Flex object's blueprint. The fixes are separate, and the first one alone does not close the second.
Plain data table (ANT-2026-JMJVILN2). Core marks the blueprint schema untrusted only when it recorded a page-authored `*@` directive. It finds those by scanning keys that contain `@`, while the underlying toolbox parser also takes a field's plain `data:` property verbatim as a dynamic call. A page whose `type: flex` form gives a field a plain `data:` table therefore keeps a trusted schema, and the call skips the `Class::method` allowlist. The reproducer saves such a page as `editor` with `\Grav\Common\GPM\Installer::replaceFile` as the provider, and one anonymous request copies a file into the web root and executes it. With a file-read provider the same primitive returns files such as `user/accounts/admin.yaml` to a logged-in user. Anonymous visitors can trigger it when the form names its object by `flex.key` without `flex.type`, because of a separate access-check gap in the Flex Objects plugin.
Import renumbering (ANT-2026-5K6AGDBQ). To learn which directives came from the page, `Blueprint::extend()` parses the page data in a throwaway blueprint. That blueprint keeps the default `blueprints://` context, while the real Flex page blueprint uses `blueprints://pages`. So `import@: { type: 'default:form/fields' }` resolves to nothing in the throwaway and to a real file in the real blueprint, which renumbers a sibling field keyed `5` to `0`. The directive is marked untrusted at `fields/5` but runs at `fields/0`, where it falls back to the file blueprint's trusted flag. The reproducer uses a `data-default@` directive this way to call `Installer::replaceFile()`. The same page with the import written with an explicit context is refused, and that is its control. This is a remaining case of the renumbering issue fixed in 2.2.13.
Cached blueprint (ANT-2026-OABPDEVA). `FlexForm::getBlueprint()` calls `extend()` and `init()` on the blueprint instance the Flex object caches, not on a copy. With `flex.layout: ''` in the frontmatter that instance is the one `FlexObject::update()` later uses to validate and filter the submitted data. Declaring the `access` field a second time in the form's `fields:` block replaces its schema entry, so the `security@: admin.super` guard and `validate.ignore` are lost and the submitted `access` map is stored. The reproducer creates a limited `manager`, has it save and submit a form for its own group, and afterwards `groups.yaml` holds `admin.super: true` and `api.super: true` and the manager's `GET /api/v1/config/system` goes from 403 to 200. With the experimental `system.accounts.type: flex`, no user-management grant is needed and any publisher can promote their own account. This is a variant of GHSA-xhfv-7758-r9hx.
Impact
A publisher gets code execution as the web server user, and a user manager becomes super admin. Starting points are an editor who can save a page with a Flex form, or an account that a super admin has granted user management.
Patches
Fixed in Grav 2.2.18. The blueprint schema is treated as untrusted once any untrusted source has been merged into it, and the plain `data:` table is dropped from the fields of an untrusted source. The throwaway parse that attributes directives to the page now uses the real blueprint context and overrides, and the directives are compared again after the real initialization. `FlexForm::getBlueprint()` extends a clone of the object's blueprint, so a page's field overrides change the form only, and the object's own blueprint, with its `security@` guard and `validate.ignore`, is the one that validates and filters the submission. Update the Flex Objects plugin to 1.4.18 as well: a page whose Flex form names a directory that does not exist, or names none, is now refused, and every Flex form on a page is checked instead of only the last one, which closes the anonymous route.
Credits
Discovered by Anthropic's OSS Scanner (ANT-2026-JMJVILN2, ANT-2026-5K6AGDBQ, ANT-2026-OABPDEVA).
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-86m3-293g-fmp6Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
