/grav-skills:grav-security-advisoriesfrom grav-skills
Triages GitHub security advisories for Grav CMS repos: matches against known bug families, checks if already fixed, assigns disposition (not-a-vuln/fix-quietly/publish), lands fixes with neutral wording, and applies advisory metadata via API.
Ships in grav-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Andy triages security advisories in one batch per week and publishes on release day. This skill runs that batch. The goal is that when the run ends, the only things left for Andy are the things GitHub will not let you do (posting advisory comments) and the calls that are his (publishing, release timing, anything in "Needs Andy").
Do the work, don't describe it. Metadata edits go straight onto the advisory through the API. Fixes get committed. Replies get written in full. If you catch yourself writing "the title should mention X" or "the description needs reframing", stop and write the replacement instead.
The single most valuable check: is it already fixed? Reporters routinely test an old tag and file against bugs patched weeks earlier. In the batch that started this workflow, 4 of 5 advisories were already fixed and released. The second most valuable: the reporter is usually right that something is broken and usually wrong about why. In a typical batch 5 of 6 reports have the right symptom and the wrong mechanism, and most confirmed bugs have sibling instances the reporter never found.
https://<name>.test) or a hosted site Andy administers. Never send a PoC or payload to a URL from the report, the reporter's own test host, or any third-party Grav site, even to check whether it is live.triage or draft is an unpublished vulnerability. Commit messages, CHANGELOG bullets, branch names, test names and any public comment use neutral wording: describe the fix ("Validate the form flash id before using it in a path"), never the attack, and never a GHSA id. This is the house precedent, and it is what lets fixes land on develop before the advisory publishes.~/Projects/grav/grav/SECURITY.md at the start of every run. It is the operative rubric and it changes. Where it and this skill disagree, SECURITY.md wins, and you should fix this skill.~/Projects/grav/<repo> on develop. Validate against the code, not memory. Sites under ~/workspace/* are runnable reeve installs, not git repos.model: "opus", one per advisory, read-only, in parallel. Full test suites never run in parallel; run the tests next to the change, and leave whole suites to one serial run at the end if at all.Grav's intake went from about 5 advisories a month to about 60 in the first half of 2026, and Grav was publishing roughly half of them. A 50% acceptance rate is what makes a project an attractive target, so the policy was rewritten: assume a report is not advisory-worthy until it demonstrably crosses a trust boundary. The target is about 25% published. If a batch comes out well above that, you are grading too generously.
Assign exactly one to every advisory and name it in the artifact. "It's a real bug" is not an argument for publishing.
| Disposition | Meaning | Reporter gets | You do |
|---|---|---|---|
| A. Not a vulnerability | In-role capability, denylist bypass, enumeration, self-XSS, no PoC, unsupported version, unreachable dependency CVE, already fixed | A polite close linking the SECURITY.md section | Write the reply. No metadata edits, no code. |
| B. Fix quietly | Real code issue, but the actor could already reach the same thing through their role, or there is no practical exploit | CHANGELOG credit, advisory closed unpublished | Land the fix, credit them in the CHANGELOG, write the reply. No metadata edits. |
| C. Publish | Crosses a trust boundary; operators on a supported version need to upgrade | Credit on the published GHSA | Land the fix, apply every metadata edit, write the reply. |
B absorbs most of what used to be published. Non-constant-time comparison with no practical oracle, permission tightening where the actor already had the data, traversal that needs admin file-manager rights, authenticated resource use with no amplification, anything that first needs the actor to install a plugin or write arbitrary files (they could already run their own PHP). The B reply should not read like a demotion.
The burden of proof is on C. Write one sentence: who the actor is, what access they start with, which boundary they cross, what they end up with. If that sentence doesn't come out clean, it is not C.
GitHub's CVSS calculator typically inflates these reports to High by assuming PR:N. When your rating differs from the reporter's, set yours and say why in one line in the artifact.
Backport to 1.7 only when it is exploitable without a publisher or admin account and has real impact (SECURITY.md "What gets backported to 1.7"). Anything needing publisher or admin access is fixed on 2.x only.
The non-default-config exemption needs both halves. "Only happens under a non-default configuration" closes a report only if the docs already warn that the setting is dangerous. Read the actual help text and grav-learn page before you invoke it. The Clockwork report failed this test because the docs recommended the feature.
These are pre-decided. A match turns a 40-minute investigation into a 5-minute close. Say so explicitly in the artifact ("Nth instance of the detectXss family, A per the register").
Security::detectXss() bypasses: always A. It is a heuristic denylist, not a boundary. Only in scope as a different finding: content that renders unescaped at an output sink, with the rendered sink shown.Utils::isDangerousFunction() bypasses: always A, same reasoning. The Twig content sandbox is the boundary. A string callable of any kind executing inside sandboxed content is in scope.isSuperAdmin() or a bare permission string instead of the scope cap). The chokepoint and ScopeCapChokepointTest are in grav-plugin-api; new instances are B unless a scoped key actually escapes its scope in a shipped release, which is C. Plugin-side requireXPermission() gates are where this keeps reappearing; the fix is the api plugin's scopeAllows(). Grep every plugin for the same gate when one turns up.Host). C only if the flow is reachable unauthenticated, otherwise B. Check all link-bearing emails, not just the reported one.scripts/advisory-pretriage.py in this skill directory gathers the evidence overnight: the full record, the reporter's CVSS, a confidence-scored family match, a re-home candidate from the source paths in the report, and an already-fixed check against the right checkout. It writes ~/Projects/grav/.advisory-triage/latest.md plus a dated copy and a JSON sidecar.
~/.claude/skills/grav-security-advisories/scripts/advisory-pretriage.py # triage + draft, all repos
~/.claude/skills/grav-security-advisories/scripts/advisory-pretriage.py --repos grav --state triage
Check the digest's date first. If latest.md is not from the last day or two, the cron is broken: look at tail /tmp/grav-pretriage.log, then just run the script by hand. Cron has no /opt/homebrew/bin in its PATH, so the crontab line must set it inline:
47 3 * * * PATH=/opt/homebrew/bin:/usr/bin:/bin $HOME/Projects/grav/grav-skills/skills/grav-security-advisories/scripts/advisory-pretriage.py >> /tmp/grav-pretriage.log 2>&1
Read the digest as evidence, not a verdict. A "likely fixed" verdict means a commit or comment cites the GHSA; confirm it with git show and git tag --contains. A low confidence family match usually came from a pattern quoted in the PoC; treat it as a hint. The re-home column is high value: classes/Api/... or user/plugins/<name>/... paths in an advisory filed on getgrav/grav mean the bug belongs to that plugin.
The script's FAMILIES list mirrors the register above. When you add a family here, add its patterns there.
gh api "repos/getgrav/<repo>/security-advisories?state=triage" --paginate
gh api repos/getgrav/<repo>/security-advisories/<GHSA-ID>
.description is the report; also .state, .severity, .cvss, .cwes, .vulnerabilities, .credits, .html_url. Advisory comment threads are not in the REST API. If the notification reason is comment, someone replied (maybe the reporter, maybe "this is fixed"); flag it for Andy to read in the UI before acting on that advisory.
Give each agent the advisory text in a scratch file, the repo paths, a strict read-only instruction (no commits, no pushes, no edits to tracked files) and the PoC rule from Ground rules. Require answers in this order:
git log -S'<marker>', git grep <GHSA-id>, git tag --contains <sha>. Name the commit and the first tag that ships it.file:line. Confirm the mechanism yourself; the reporter's is often wrong while the symptom is real..test install, with the exact request or steps and what came back.git show "${tag}:${file}" across tags), not just the version the reporter tested. Whether 1.7 is affected and qualifies for a backport.Spot-check every "already fixed" and every negative finding yourself before it goes in the artifact. A negative result from a loop is guilty until proven innocent (see House conventions).
develop (for grav-plugin-api, check out develop explicitly; main also exists and is its release branch).@handle for B items. Never invent a first name from a handle.vendor/bin/codecept in core), and confirm the new test fails without the fix.1.7 branch with the same neutral wording.develop (and 1.7) once tests pass, after checking git log origin/develop..develop holds only your commits. If Andy has unpushed local work on the branch, don't push; list it in Needs Andy.develop with no advisory, whatever their severity. Give each one its own [security] CHANGELOG bullet with no credit, separate from any reporter's bullet, so it is on record in the release notes.Do this through the API, not as a list for Andy. Build the body with jq --rawfile so a multi-paragraph description survives without shell quoting:
jq -n \
--arg summary "Publisher can read site configuration through page Twig" \
--rawfile description desc.md \
'{summary: $summary,
description: $description,
severity: "high",
cvss_vector_string: null,
cwe_ids: ["CWE-200"],
vulnerabilities: [
{package: {ecosystem: "composer", name: "getgrav/grav"},
vulnerable_version_range: ">= 2.0.0, < 2.1.11", patched_versions: "2.1.11"},
{package: {ecosystem: "composer", name: "getgrav/grav"},
vulnerable_version_range: "< 1.7.53.5", patched_versions: "1.7.53.5"}
]}' > body.json
gh api -X PATCH repos/getgrav/<repo>/security-advisories/<GHSA-ID> --input body.json
gh api repos/getgrav/<repo>/security-advisories/<GHSA-ID> | jq '{summary,severity,cvss,cwes,vulnerabilities}'
Then read it back and confirm every field took.
critical/high/medium/low (there is no moderate). A CVSS vector makes GitHub recompute the label, so to hold a rubric severity that differs from the calculator, clear the vector (null) and set severity alone.vulnerabilities[].package change to getgrav/grav-plugin-<name>. GitHub has no advisory transfer; the advisory stays hosted where it was filed, and the reporter thread and credit survive. A blank ecosystem leaves the advisory unmapped in the GHSA database.vulnerabilities is replaced wholesale, so send every entry, including a separate one for the 1.7 line when it is affected..credits; add them (credits: [{login, type: "reporter"}]) if not.## Summary / ## Affected versions / ## Details / ## Impact / ## Patches / ## Credits. Where you overrode their assessment, say so in the text ("The original report described this as unauthenticated. Exploitation requires a publisher account."). Common corrections: a hedge on something you confirmed, reach that doesn't exist in the code, a headline payload that turned out inert while a variant is live, an affected range that names only the tested version, a title that is internal shorthand instead of something an operator can act on.Grav does not request CVEs (SECURITY.md), so never call the CVE endpoint.
gh api -X PATCH repos/getgrav/<repo>/security-advisories/<GHSA-ID> -f state=closed. (He may also click Close in the UI right after pasting; check the state before closing.)-f state=published. Check the metadata once more first; the patched version must match a real tag.getgrav/<repo>-ghsa-xxxx) with open PRs block publishing. If the PR's commit is already public (git tag --contains <sha>), close it with gh pr close N -R getgrav/<fork> and no --comment (workspace repos reject comments).gh api -X DELETE notifications/threads/<thread-id>. Andy tracks advisories through this skill and the digest, not the inbox. Never treat an advisory's absence from the inbox as evidence it was resolved.Put these in their own section at the top of the artifact, each with your recommendation and the text he'd need:
[email protected], a broken cron).Fill the brackets, keep them short and warm. These reporters are acting in good faith, and a curt close is what generates follow-ups that cost more than the triage. Always link the SECURITY.md section so the close reads as policy. They post under Andy's name: no em-dashes, and @handle rather than a guessed first name.
A, in-role capability:
Thanks for taking the time on this, and for the clear write-up.
This one falls under our trust-boundary policy: [the actor] already has [capability], so [doing X] is within the scope they were granted rather than an escape from it. We rate by whether an actor can escape their role's trust scope, not by what a role is technically able to do. The reasoning is in our security policy:
https://github.com/getgrav/grav/blob/develop/SECURITY.md#triangular_ruler-how-we-decide-what-is-a-vulnerability
Closing on that basis. We do appreciate the report and hope you'll keep an eye on Grav.
A, denylist bypass (detectXss or isDangerousFunction):
Thanks for the report.
[`Security::detectXss()` / `Utils::isDangerousFunction()`] is a denylist. It exists to catch common mistakes, it has never been complete, and a denylist over an open input space can't be. It isn't a security boundary: [Grav's XSS defense is escaping at output / the Twig content sandbox is the boundary]. A new value that slips past the list isn't a vulnerability on its own, and our policy says so explicitly:
https://github.com/getgrav/grav/blob/develop/SECURITY.md#no_entry-what-we-do-not-publish-an-advisory-for
If you can show [this payload rendering unescaped at an output sink / a string callable executing inside sandboxed content], that's a genuine finding and we'd very much like to see it. Please open a new report that includes the rendered result.
A, no PoC:
Thanks for flagging this.
We can't act on this as filed. We need a minimal, working proof of concept that we can run to confirm both the issue and the fix, plus the exact version and commit tested. We're a small team and don't have the capacity to build the PoC from a code reading, so reports without one get closed.
https://github.com/getgrav/grav/blob/develop/SECURITY.md#pencil-reporting-a-vulnerability
If you can put a working PoC together, please refile and we'll take a proper look.
A, already fixed:
Thanks for the report. Good catch, though it turns out you were testing behind the fix.
This was resolved in [VERSION] ([commit]). You tested [tested version]; upgrading clears it.
Closing as already fixed, but the analysis was sound and we'd welcome more.
B, fix quietly:
Thanks, this is a real improvement and we're taking the fix.
We're not issuing an advisory for it: [the actor could already reach the same thing through their granted role / there's no practical exploit path], so there's nothing operators need to act on urgently. It ships in [VERSION] and you're credited in the CHANGELOG. Our policy on advisories vs. quiet fixes is here:
https://github.com/getgrav/grav/blob/develop/SECURITY.md#no_entry-what-we-do-not-publish-an-advisory-for
Appreciate the report.
C, accepted:
Thanks for the report, confirmed and fixed.
[One or two sentences on what we changed from the report and why, e.g. "Exploitation needs a publisher account, so we've rated it High rather than Critical, and the affected range goes back to 2.0.0."] The fix ships in [VERSION] and the advisory publishes with that release, with you credited.
Thanks again for the careful work.
Re-homed (append to whichever reply applies):
This code lives in [PLUGIN] rather than Grav core, so we've pointed the advisory at that package. Nothing needed from you.
Always publish one, every batch. Its main job is copy and paste: advisory comments have no API, so Andy posts every reply by hand, and the artifact is where he does it. Each reply sits in its own copy block with a working Copy button, next to a link to the advisory it goes on. Never hand replies over as scratch-file paths or a wall of chat text instead; the scratchpad is wiped at midnight and chat mangles them. If the full review is not ready, publish the replies first and add the rest after.
Keep it lean. The fixes, metadata and descriptions already live on GitHub, so the cards carry decisions and links, not write-ups: one line of mechanism, no PoC payloads or step-by-step exploit detail. The artifact is for reading and pasting, not a second copy of the advisory.
One artifact per batch, published as an HTML Artifact, updated in place as things change. Andy acts straight off it, so republish before reporting a change in chat, and never leave a superseded recommendation in it.
reason: comment advisories as "unread thread, check the UI first".The terminal reply summarizes what was done, what is waiting on Andy, and links the artifact. It does not repeat the replies.
set -- $spec leaves $2 empty. Use functions with explicit args. (2) :c, :t, :h are history modifiers even inside double quotes: git show "$t:classes/Foo.php" mangles the path, the piped grep -c counts 0, and the loop reports a shipped release as clean. Always brace: "${t}:${f}". (3) Unquoted globs in flags die before the command runs: quote --include='*.yaml' or use git grep -- '*.yaml'.gh call writes a ~29-byte error into the output file and keeps going. Print OK/FAIL from the exit code and check sizes.UserObject::authorize() returns false for any user loaded from disk (it short-circuits before the ACL). Privilege checks on a loaded, non-session user are silent no-ops; reporter patches that rely on it fail.isSandboxed() with no Source is always false in Grav; a guard that relies on it never fires in production.Co-Authored-By trailers. Clear caches with bin/grav clear. Releases: grav-plugin-api and a few others release to main, core and most plugins use git-flow on master/develop.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
9 skills in this plugin
/grav-2-migrationUse when migrating an existing Grav 1.7/1.8 site to Grav 2.0 by hand — the agent-driven equivalent of what the `migrate-grav` plugin's wizard does, for sites where core is swapped in place (git checkout, deploy pipeline, rsync) rather than staged in a subdirectory and promoted. Covers the whole sequence: preflight and a restore point, swapping core, bringing plugins/themes to their 2.0 releases and replacing classic `admin` with `admin2` + `api`, translating classic `admin.*` account and group permissions into the `api.*` set 2.0 actually enforces (including the `api.access` gate no 1.x permission corresponds to), reopening the `security.twig_content` gates and seeding `security.twig_sandbox` allowlists from the site's own content, `system.images.url_actions`, the GFM `tagfilter`, and verifying the result. Trigger when the user says "migrate this site to Grav 2", "upgrade my 1.7 site to 2.0", asks to do what migrate-grav does without running the plugin, or asks why Twig in content, image resizing, raw HTML, or a user's permissions broke after moving to Grav 2.0./grav-admin-ui-polishUse when reviewing, auditing or polishing the admin UI of a Grav 2.0 plugin that renders inside Admin Next (admin2) — a plugin page in component mode, an add-on section, a dashboard widget, a custom field, or a blueprint settings form. Covers the review method (walk both themes plus a tablet width via the same-origin iframe trick, read-only, demo rows injected client-side when the seed is empty, then one code-side consistency pass against the host's own tokens), the ten design rules that repeat across every view (status registry instead of raw enums, the zero-value rule, one primary per screen with destructive neutral at rest, one entry point per row with a ⋯ menu, collapsed creation forms, effective state instead of stored flags, one date and number format, counts for the whole result set, prose into `<details>`, every "see X" a link, every editor a route with a dirty guard, sub-nav groups, empty states with a CTA), host fit against Admin Next's `--background/--muted/--border/--input/--ring/--success/--warning/--destructive` custom properties and its badge/button/card/table/tabs/segmented/input conventions, the `--kc-*`-style token block and constructable-stylesheet pattern, the primitives a plugin admin needs (`status()`, `rowActions()`, `emptyState()`, `.table-scroll`, route + dirty-guard helpers, formatting helpers), the `ctx.ui` / `ctx.sheet` / `ctx.route` / `ctx.navigate` / `ctx.setTitle` contract an add-on section is handed, blueprint label and help-text rules, a twelve-item rendering-defect checklist, and the host/API limitations to plan around. Trigger when the user says "review the admin UI", "polish this plugin page", "make it feel native", "make it look premium", "bring it in line with KahunaCart", or mentions Admin Next, admin2, plugin page, kc-view, web component admin UI, blueprint labels/help, status pills, dark mode contrast, rendering defects, or a UI review of a Kahuna add-on (subscriptions, licenses, payment providers)./grav-api-admin-next-integrationUse when integrating a Grav 2.0 plugin with Admin Next (the new SvelteKit SPA admin) and the API plugin. Covers all integration points: API endpoints (`onApiRegisterRoutes`), sidebar items, menubar/toolbar buttons, floating widgets, modal dialogs (`window.__GRAV_DIALOGS.form()`/`.open()` and the page-creation deep link), plugin pages (blueprint and component modes), custom field types, custom reports, blueprint modifications, permissions, languages, and config exposure to web components. Trigger when migrating an admin-classic plugin to Admin Next, when adding any Admin Next UI to a plugin, when working under `user/plugins/<plugin>/admin-next/` or on event handlers prefixed `onApi*`, or when the user mentions admin-next, custom field type, sidebar nav, floating widget, modal dialog, plugin page, custom report, or any of the `onApi*` events. Use the lighter `grav-api-integration` skill instead if the plugin only needs API endpoints with no admin UI./grav-api-integrationUse when adding REST API endpoints to a Grav 2.0 plugin via the first-party Grav API plugin. Covers controller setup extending AbstractApiController, route registration via `onApiRegisterRoutes`, permission checks, response helpers, exceptions, and curl-based testing. Trigger when working under `user/plugins/<plugin>/` on code that exposes plugin functionality as HTTP endpoints, or when the user mentions Grav API, AbstractApiController, ApiResponse, or onApiRegisterRoutes. Use the broader `grav-api-admin-next-integration` skill instead if the plugin also needs custom Admin Next UI (sidebar, menubar, fields, pages, widgets, panels, reports)./grav-inbox-triageUse for Andy's daily sweep of his GitHub notifications on the Grav org (getgrav/*): issues, pull requests, discussions and mentions. Trigger on "do my inbox", "triage my notifications", "daily inbox", "clear my github inbox", or a request to work through getgrav issues and PRs. Runs end to end without check-ins: reproduces each bug on a local reeve install, fixes it on the repo that actually owns the code (often not where it was filed), verifies the fix, merges contributor PRs with corrections applied on top, commits and pushes to develop with a CHANGELOG bullet, posts a short reply, closes the issue, and marks the notification done. Only items that need a decision from Andy (product or design calls, behavior or interface changes, releases, anything that couldn't be verified) stop and wait. Security advisories are left for the weekly grav-security-advisories run./grav-plugin-reviewUse when reviewing a third-party Grav 2.0 / Admin2 plugin for compatibility and security, especially a GPM (`getgrav/grav` `[add-resource]`) submission. Covers the review method (clone, map, cross-check against the real api/admin2/login plugins in the workspace), the verified API/Admin2 integration contract (which `onApi*` events exist, `AbstractApiController` shape, public-route mechanism, component-page convention, settings-panel secret-leak vector), and a findings taxonomy with concrete fixes: manifest/GPM correctness, auth granularity, secret handling, unauthenticated public writes, CSV/mail-header injection, XSS escaping, path traversal in file-serving, SVG upload, open proxies, pure-PHP SSE worker exhaustion, CSRF, message/identity spoofing, account mass-assignment, plus citizen-behavior and author-branding-in-defaults smells. Also covers how to produce a paste-ready, file:line-referenced handoff. Trigger when the user asks to review/vet/audit a Grav plugin, asks about a GPM submission, links a `grav-plugin-*` repo for review, or mentions checking a plugin for Grav 2.0 / Admin2 compatibility.npx claudepluginhub getgrav/grav-skills --plugin grav-skills