/mokata:frontend-securityfrom mokata
Audits React web apps for frontend security: authorization on server entry points, data exposure to client, secrets in bundles, and injection sinks. Audit first, fix on request.
Ships in mokata. 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.
mokata Agent Skill. This is mokata's
frontend-securitydomain knowledge. mokata LOADS it when the approved spec routes both a React web surface and a security surface — never on a prompt keyword. It specialises thesecurityskill for the browser/server-rendering boundary and feeds the secret-guard that already runs on every write. Durable writes are human-gated.
⛭ mokata frontend-security active — gate: secrets hard-block a write or egress; human approval cannot override
Audit first, fix on request. Each check below follows the same shape as performance work: prove the weakness (a request that should be refused and is not), fix the smallest thing, verify the same request is now refused, guard it with a test. A finding without a reproduction is a suspicion; say which one you have.
dangerouslySetInnerHTML with anything user-influenced, href/src built
from user input (a javascript: URL), and direct DOM writes (innerHTML) need sanitization or a
safer construct. A strict Content-Security-Policy and Trusted Types reduce the blast radius; roll
them out report-only first. (https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP ·
https://developer.mozilla.org/en-US/docs/Web/API/Trusted_Types_API)Browser-support figures, CVE identifiers and patched-version numbers are UNVERIFIED in this skill on purpose: read the advisory or the cited page for the project's versions before quoting one.
This guidance runs inside a pipeline phase. If that phase appears stuck, or the harness stops it mid-run: run mokata resume (where the run stands and the gate that still applies) and mokata approve --list (anything waiting on a human). Nothing is lost — run state, approvals and the audit ledger are on disk — so re-invoke the phase to continue; mokata doctor names a hung MCP server or a hook that is not firing.
| Rationalization | Reality |
|---|---|
| "The button is only shown to admins." | The Server Function behind it accepts a direct POST from anyone. Check inside the function. |
| "Middleware already checks the session." | Middleware is path-matched and has been bypassed repeatedly; authorize where the data is touched. |
| "It's just the public API key." | Read what the key can do. If it can write, bill, or read private data, it is a secret, prefix or not. |
| "React escapes everything." | Except dangerouslySetInnerHTML, URL attributes and direct DOM writes — exactly the sinks to check. |
| "We'll add the dependency now and review later." | Install scripts run at install time; the review has to come first. |
Evidence, not "seems right" — check every box or say which is unmet and why:
references/authorization-first.md — proving and fixing broken access control on Server Functions and route handlers, with an Incorrect/Correct pair and the direct-POST testreferences/bundle-secrets-and-sinks.md — finding secrets in build output and handling the HTML/URL sinks, with Incorrect/Correct pairsCAN
guardrail to memory + the ledger (human-gated)MUST NOT
DEPENDS ON
frontend-security (routed when frontend-react and security are both in play) (advisory)Grounding:
(gate: …)boundaries are enforced by that gate in code;(advisory)ones are protocol discipline this skill follows, not a hard block.
What SKILL.md sets; muted values are Claude Code's defaults
Engage when mokata's per-turn routing or `spec show` names `frontend-security` for this run, when the spec's `domains` carry both `frontend-react` and `security`, when a React web change adds or changes a Server Function, a route handler, a page that reads protected data, or an environment variable exposed to the client, or when a change renders user-controlled HTML or URLs. Do NOT engage for a backend-only service (the `security` skill covers it), for a React Native app, or for a purely visual change that touches no data, input, or route.
npx claudepluginhub jasgujral/mokata-oss --plugin mokata30 skills in this plugin
/apimokata · API & interface design — contract-first, blast-radius on every change./backend-nestjsmokata · NestJS rule pack — impact-ordered rules for modules, guards, DTOs and providers, loaded by the spec's routing./brainstormmokata · Socratic pre-spec exploration — explore approaches WITH the user, one question at a time, and HARD-GATE the spec behind explicit approval. Runs standalone or as the front of mokata's pipeline./browser-testingmokata · Browser testing (DevTools) — live runtime captured via the existing MCP surface, fed to the test gate./bugmokata · Start from a reproducer and a failing test, then fix./ci-cdmokata · CI/CD & automation — the quality-gate pipeline + Scorecard posture, not a suggestion.Other plugins' skills for the same job