/fe:frontend-securityfrom Frontend Skills
Browser-side security for React and Next.js apps, mapped to OWASP — XSS and safe rendering with one sanitiser policy shared with the server, the security headers every app sends from its own config, a Content Security Policy and how strict it can be with Cache Components, Trusted Types, framing and postMessage, third-party scripts and SRI, secrets and tokens in the client, open redirects, and the other client pitfalls. Use when building or reviewing frontend code, a page's headers, or a third-party script.
Ships in Frontend 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.
Everything shipped to the browser can be read and edited: the source, every public value, the state in memory, every network call. So the client never enforces anything — the server re-decides it all (backend-security) — and nothing sensitive lives there. What the client does own is not running someone else's code: escaping and sanitising what it renders, and sending headers that tell the browser what it may run, frame and fetch.
Before applying this skill, read the project's root AGENTS.md, the AGENTS.md closest to the files in question, and any doc they link for this skill's topic. Names, values and choices — budgets, tiers, tokens, voice, paths — come from those files, never from this skill.
unsafe-*, production source maps, verbose client errors.devops').javascript: URL in href, src, action or formAction into one that does nothing. The danger is where React doesn't reach — data: and other schemes, style, spread props from untrusted objects, dangerouslySetInnerHTML, and sinks outside React (location, router.push, window.open).dangerouslySetInnerHTML appears. It reads the same policy the server applies when it saves rich text — RICH_TEXT_POLICY from the shared contracts: tags, attributes per tag and URL schemes (backend-security): the server is the authority, and the client sanitises again because what it renders may not have come through that save.innerHTML, outerHTML, insertAdjacentHTML, document.write, eval, new Function, string setTimeout/setInterval, on… attributes, assignments to location, href or src. No untrusted input reaches them, and eval and new Function aren't used at all.z.httpUrl() — http: and https: only (schemas-and-contracts); mailto: and tel: appear only in links the app builds itself. javascript:, data:, blob: and vbscript: never pass.location, document.referrer, postMessage data, API responses, and pasted or dropped HTML (getData("text/html")).id and name values that shadow globals — keep DOMPurify's SANITIZE_DOM on, add SANITIZE_NAMED_PROPS, and never look up user HTML by name.seo-aeo-geo's component, which escapes < so a value can't close the script tag.Each app sends the same baseline on every response, from its own next.config headers(), matched on /:path*. The block is written out in each app and changed in all of them in the same change, so no app drifts; an app adds only what's its own (X-Robots-Tag, seo-aeo-geo).
| Header | Value | Why |
|---|---|---|
Strict-Transport-Security | max-age=63072000; includeSubDomains (preload once decided) | HTTPS only, for two years; preloading commits every subdomain, so it's a decision |
X-Content-Type-Options | nosniff | a response is never sniffed into a script |
Referrer-Policy | strict-origin-when-cross-origin, or stricter | paths and queries don't leak to other sites |
X-Frame-Options | DENY | for browsers without frame-ancestors |
Permissions-Policy | every unused feature off (camera=(), microphone=(), geolocation=()) | an app grants a feature only for the page that uses it; an injected script can use it |
Cross-Origin-Opener-Policy | same-origin-allow-popups where sign-in opens a popup, else same-origin | another window can't hold a reference to the page |
Cross-Origin-Resource-Policy | same-site | another site can't embed the app's responses |
Content-Security-Policy | below | what the page may run, load and connect to |
Cache-Control: no-store, so a shared or back-button cache never holds them.X-XSS-Protection is not sent (or sent as 0): the old filter it controlled caused vulnerabilities of its own. poweredByHeader: false removes X-Powered-By.A CSP tells the browser what a page may run, load and connect to, so script that slipped through doesn't run. How strict the script part can be depends on how the app renders:
nextjs), a strict script policy isn't available yet. A nonce needs the request's headers, which a static shell doesn't have (Next.js: Partial Prerendering is incompatible with nonces); a hash through experimental.sri covers external scripts but not Next's inline flight scripts, so a strict script-src blocks hydration (vercel/next.js#95354). Such an app sends every other directive strictly and script-src 'self' 'unsafe-inline', recorded as a known gap and reviewed when Next supports a strict policy with Cache Components.proxy.ts makes one per request, sets it in the header and in x-nonce, and the layout reads x-nonce from headers() and passes it to every <Script nonce>. The cost is that nothing is static or cached at the CDN.Either way:
default-src 'self'; object-src 'none'; base-uri 'none'; form-action 'self'; frame-ancestors 'none' unless the app is meant to be embedded; upgrade-insecure-requests; and explicit lists for connect-src, img-src and frame-src — the API, the image CDN, and Firebase Auth (identitytoolkit.googleapis.com and securetoken.googleapis.com in connect-src, the auth domain in frame-src for the sign-in popup). A loose connect-src lets injected script send data anywhere.'unsafe-eval' never ships. Local development needs it for React's error overlay, and style-src 'unsafe-inline'; branch on the local tier (APP_ENV), never NODE_ENV (env). Server-rendered style="…" attributes need style-src-attr 'unsafe-inline' in production too, a far smaller risk than script; record it when used.Content-Security-Policy-Report-Only, reporting through Reporting-Endpoints and report-to, plus report-uri for browsers that lack report-to; enforce once the reports are clean, and keep reporting after.missing matcher on next-router-prefetch and purpose: prefetch), so a nonce isn't minted for them.require-trusted-types-for 'script') turn every DOM sink into a checked operation, and every major browser supports it. It stays report-only until everything that writes to a sink has a policy: React 19.3 or later, the sanitiser returning TrustedHTML (DOMPurify's RETURN_TRUSTED_TYPE, policy dompurify), Next's runtime, and libraries such as the consent banner, which writes innerHTML without one.The headers block, both CSP setups and the sanitiser are in references/frontend-hardening.md.
frame-ancestors 'none' and X-Frame-Options: DENY) unless the app is built to be embedded. Then only named ancestors are allowed, and X-Frame-Options is left out: it can't name an origin, and a browser that ignores frame-ancestors would block the embed.postMessage: every received message checks event.origin against an allowlist and parses the payload with a schema before acting; every sent message names its target origin, never "*".allow-scripts with allow-same-origin undoes the sandbox only for a document from your own origin — never give both to one — while a cross-origin embed (a video, a map) often needs both and can't reach your origin. Embeds that set cookies load only after consent (cookie-consent).cookie-consent), and their origins are named in the CSP.integrity and crossorigin) on every fixed, versioned file from a CDN, so a changed file fails to load instead of running. Scripts whose content changes by design — Google's tags — can't take SRI; they load only after consent, from origins named in the CSP.env), and a key that must be in the client (a public analytics or maps key) is safe to expose and restricted by origin at its provider.auth): script can't read it, so XSS can't steal it. No token goes in localStorage or sessionStorage; a short-lived token the client SDK needs lives in memory only.localStorage, analytics payloads, console or devtools-visible state; production source maps aren't served publicly; a service worker never caches signed-in responses.?redirect= is followed only when it's a same-origin path (safeRedirectPath, auth).Clear-Site-Data (auth).target="_blank" links carry rel="noopener noreferrer".__proto__ or constructor.backend-security); the client sends requests same-origin, never defeats SameSite, and treats a Server Action as a public endpoint like any route.URL.createObjectURL and revoke it; an uploaded SVG is never rendered inline (image-handling).mode: "no-cors"; credentials: "include" goes only to the product's own origins.postMessage origins; sandbox embeds; SRI on CDN files; keep the session in an httpOnly cookie.unsafe-eval; use the hash route with an App Router app (it blocks hydration); set a nonce CSP without knowing it makes every page dynamic; grant a permission an app doesn't use; store a token in web storage; ship a secret in a public variable; postMessage to "*"; follow an unchecked redirect; load a tracking script before consent.Server-side threats, CSRF and Server Actions backend-security · the session cookie auth · public values and tiers env · the safe URL schema schemas-and-contracts · consent before scripts cookie-consent · proxy and rendering nextjs · indexing headers seo-aeo-geo · uploads image-handling · dependency gates devops · a full review security-audit.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub timonwa/engineering-skills --plugin fe20 skills in this plugin
/accessibilityBuilding UI that meets WCAG 2.2 AA beyond the markup — text alternatives, contrast checked on the tokens in both themes, reflow and zoom, keyboard and focus (order, visibility, dialogs, skip link, not obscured), target size, pointer and motion, labels, errors people see, accessible sign-in, ARIA states and live regions, and the gates that verify it: lint, Storybook axe at error, keyboard stories and screen-reader passes. Use when building or reviewing any interactive UI, a form, a dialog or a colour token./accessibility-auditManually invoked. Red-team accessibility audit of an app or a diff against WCAG 2.2 AA, organised by POUR with each check citing its success criterion — structure and landmarks, contrast on the tokens in both themes, reflow and zoom, keyboard, focus and dialogs, pointer and target size, forms and errors that are seen, status messages, and the lint, Storybook and end-to-end gates. Verifies each finding and writes a prioritized report./content-auditManually invoked. Copy audit of an app, its emails or a diff, against the project's own voice, word list and banned words and the plain-language standards (GOV.UK, NN/g, WCAG) — point-first writing, marketing claims and calls to action, buttons and links, form labels and errors, empty, success and loading states, sentence case and mechanics, accessible words and alt text, translation-safe strings, and each transactional email's sender, subject, preheader and body. Verifies each finding and writes a prioritized report.Other plugins' skills for the same job