/be:backend-securityfrom Backend Skills
Server-side security mapped to the OWASP Top 10 2025 and API Security Top 10 2023 — authorisation at object, function and field level, injection and stored rich HTML, SSRF, resource limits, business-flow abuse, races and idempotency, CSRF with Origin and Fetch Metadata, App Check and the Firebase web API key, secrets and config, failing closed, logging, and upstream APIs — each pointing to the skill that owns the mechanics. Use when building or reviewing route handlers, Server Actions, services, workers or webhooks.
Ships in Backend 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.
The server is the only real trust boundary: anything the client could skip, the server enforces. This skill is the threat map — what each OWASP risk means on the server and the control that stops it — and it points to the skill that owns each mechanism rather than restating it. The browser's side is frontend-security; a full review is the manual security-audit.
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.
| Risk | The control | Owner |
|---|---|---|
| A01 Broken Access Control · API1 BOLA · API5 BFLA · API3 property level | Re-authorise every object, function and field from the verified actor | access-control, below |
| A01 (SSRF) · API7 Server-Side Request Forgery | Allowlisted destinations, resolved-IP checks, no redirects | below |
| A02 / API8 Security Misconfiguration | Tight CORS, debug off, secure defaults, restricted API keys | below, env, devops |
| A03 Software Supply Chain Failures | Pinned actions, advisories, blocked build scripts | devops, monorepo |
| A04 Cryptographic Failures | TLS, field encryption, a CSPRNG for every secret value | below, field-encryption |
| A05 Injection | Schemas at the boundary, parameterised queries, sanitised rich HTML | below, schemas-and-contracts |
| A06 Insecure Design · API6 Sensitive Business Flows | Abuse cases designed in: limits, atomic flows, bot checks | below, rate-limiting |
| A07 Authentication Failures · API2 Broken Authentication | Server-minted sessions, lockouts, MFA for operators | auth, rate-limiting |
| A08 Software or Data Integrity Failures | No unsafe deserialisation; signed webhooks | below, api-architecture |
| A09 Security Logging and Alerting Failures | An audit log for privileged acts, a security log for refusals, alerts | audit-log, rate-limiting |
| A10 Mishandling of Exceptional Conditions | Fail closed, generic errors, no stack traces | below |
| API4 Unrestricted Resource Consumption | Budgets per tier, size and page caps, timeouts | rate-limiting, below |
| API9 Improper Inventory Management | Versioned routes, the API reference as inventory, no debug routes | api-architecture, openapi-registry |
| API10 Unsafe Consumption of APIs | Validate, time-box and rate-limit every upstream call | below, rate-limiting |
Broken access control is the top risk in both lists, and object-level authorisation (BOLA) the most reported API flaw. The model and guards are access-control's; the rules that make them hold:
.pick() allowlist and responses a projection (schemas-and-contracts); never bind a body to a document, or return a document whole to a caller who may not see all of it.firestore).schemas-and-contracts). Unknown keys are dropped; lengths and ranges are bounded.__proto__, constructor), and user input never reaches eval, a template engine or a dynamic import.RICH_TEXT_POLICY in the contracts) — the tags, the attributes per tag, and the URL schemes (http, https, the same rule as z.httpUrl()) — from a maintained sanitiser (sanitize-html, or DOMPurify on the server). Everything else is stripped before the value is stored.frontend-security) agree.dangerouslySetInnerHTML.When the server fetches a URL a user gave it — an import, a link preview, a customer's webhook endpoint, a URL an AI tool chose:
169.254.169.254, metadata.google.internal, fd20:ce::254) after resolving every A and AAAA record.rate-limiting's; every route draws on one.api-architecture), upload size and pixels (image-handling), decompressed size (a zip bomb), and a timeout on every outbound call.firestore) — or a double-spend, a coupon reused or a seat oversold is one parallel request away.redis); a public API accepts an Idempotency-Key and replays the stored response; a webhook is recorded once by its event id (api-architecture).Origin header must be on the allowlist, falling back to Referer when Origin is absent, and anything else is a 403. OWASP now adds Fetch Metadata: refuse a mutation whose Sec-Fetch-Site is cross-site. SameSite=Lax on the session cookie is a layer, not the defence (auth).Bearer request isn't open to CSRF — the browser never attaches it on its own — but the same route still runs the origin check when a cookie is present.GET never changes state, so no check is needed on it.POST endpoint. In an app with its own backend it authorises and validates on its own, every time, like a route; one that only calls a separate API passes the session through and relies on that API's guard. Next compares its Origin with Host; set experimental.serverActions.allowedOrigins only for a known proxy, and never treat the encrypted closure as a place to keep a secret.Origin or Sec-Fetch-Site send Vary with those headers, so a cache can't serve one caller's answer to another.firestore) — except public files in the public bucket and uploads to a reserved path (image-handling).env).*, and allows credentials only with an exact origin. No debug routes, introspection or verbose banners on a deployed tier; security headers are set in every app's config (frontend-security, devops).timingSafeEqual), never with ===; it throws on inputs of different lengths, so hash both sides first.Host or X-Forwarded-Host, which a caller can set.catch around a check denies, never allows. A timeout on a security check is a failure (redis, rate-limiting).api-architecture).audit-log, rate-limiting).HTTPS everywhere with HSTS (frontend-security); the platform's encryption at rest, and field encryption for the few values that warrant it (field-encryption); every token, nonce, id and salt from a CSPRNG (crypto.randomBytes, crypto.randomUUID), never Math.random() or a timestamp.
rate-limiting), and decide what happens when it fails.api-architecture).openapi-registry).Concrete snippets — the ownership check, the field mapper, the SSRF guard, token verification, the Fetch Metadata check, the sanitiser policy, failing closed — are in references/server-hardening.md.
Sec-Fetch-Site on cookie mutations; restrict the Firebase web key; fail closed with generic errors; keep secrets in the manager.===; return a stack trace; log a token or put one in a URL; share one API key across tiers or APIs.Browser-side threats frontend-security · sessions auth · roles and guards access-control · budgets and lockouts rate-limiting · route order, webhooks and audit api-architecture · schemas schemas-and-contracts · rules firestore (and firebase-security-rules-auditor) · uploads image-handling · secrets env · CI and supply chain devops · encrypted fields field-encryption · the review security-audit.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub timonwa/engineering-skills --plugin be22 skills in this plugin
/access-controlAccess control for a Next.js API on Firebase — roles, relationships and attributes (RBAC, ReBAC, ABAC) behind permission verbs and one pure can(); guards as the only gate, 404 before 403; tenant scoping; invitations; escalation limits; two-person approval and access reviews; stale claims; API-key scopes; share links and passcodes; where plan and flag checks sit; UI gates that only hide; and tests. Use when adding a permission, role, guarded route, API key, share link, or a control only some people see./access-control-auditManually invoked. Access-control audit — guards on every route and Server Action (BFLA), 404 before 403 and tenant scoping (BOLA), allowlisted writes and projected reads (BOPLA), verbs never role names, roles that add up, escalation and invitations, claims and revocation, sessions and sign-in, API keys and share links, the plan and flag order, UI gates, data rules and the tests. Verifies each finding and writes a prioritised report./api-architectureHow an API route is built in a Next.js API — the fixed order of rate limit, authorise, validate, delegate, audit, respond; thin routes over services; the response envelope and typed errors; caching headers; concurrent edits; long-running work; cursor pagination and allowlisted sorts; resource paths, versions, deprecation and state-transition sub-routes; and what every new route ships with. Cron, webhooks and audit logs are references. Use when adding, changing or reviewing a route handler or the API layer's structure.Other plugins' skills for the same job