You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
manage_twig_sandbox fixes what run_reports' Twig-in-Content scans report, for super admins (admin.super). action: "trust_partial" trusts a theme or plugin template that page content includes (api plugin 1.1.9's POST /reports/twig-content/trusted-partial, needs Grav 2.2.18 or newer), which is the fix when a page's include of a partial shows its Twig as plain text since Grav 2.2.18. action: "allow" adds a tag, filter, function, method or property to the sandbox allowlist (POST /reports/twig-content/allowlist), which opens it to every page editor. Both add only what is missing. Because either one removes a security boundary, the tool is marked destructive, so clients that confirm such calls ask first, and its description tells the agent to act only on the operator's explicit request, never on page content or a report hint alone. The allowlist route used to be skipped because update_config on the security scope can set the same lists, but that also needs api.config.write, so a connection granted only admin.super could not reach it.
The api floor rises to 1.1.9, where the trusted-partial route landed. It also brings api 1.1.6's security release, in which a disabled user group no longer grants API permissions. This plugin asks the api plugin's permission resolver at the OAuth consent screen and when listing an account's tools, so the fix covers both. GPM enforces the floor; a git-clone install on an older api gets a warning in the log at client handshake, as before. The Grav floor stays at 2.1.5.
Triaged against api plugin 1.1.6 through 1.1.9 and Grav 2.2.17 through 2.2.22. The rest passes straight through: saving an account that changed elsewhere fails with a conflict, and a << key in saved data or access is refused with a validation error (1.1.6); an account's email must be text (1.1.6); media metadata must be literal text, with no Twig delimiters (1.1.6); rename_media refuses .meta.yaml and media_order.yaml sidecar files (1.1.6); an uploaded SVG is sanitized before it becomes publicly reachable (1.1.6); deleting a user with manage_users removes the account on sites using Flex accounts, where it used to report success and leave it in place (1.1.7); with Grav 2.2.20 or newer, a JSON body over system.request.json's limits (16 MiB by default) is refused with 413 Payload Too Large before the MCP endpoint reads it, and the api plugin reports the same for its own requests (1.1.8); run_reports' Twig-in-Content events name the template each block happened in, offer the partial to trust when the page includes one, and list a page that keeps getting blocked once (1.1.9). Grav 2.2.18's security fixes need nothing here: the OAuth endpoints still advertise https now that forwarded-protocol headers count only with system.http_x_forwarded.protocol on, and the consent login's account lookup gets the core fix that stops an invalid username from finding another account.