From Secure Development
Security best practices for building and reviewing software, web apps, APIs, and infrastructure. Use whenever writing, designing, modifying, or auditing code — especially anything that handles user input, authentication, authorization, sessions, secrets, cryptography, databases, file uploads, network/HTTP requests, APIs, LLM/AI features, realtime/WebSockets, payments, PII, deployment/cloud/containers, or when reusing/pasting code (including AI-generated or copied Stack Overflow snippets) — to prevent vulnerabilities (injection, XSS, SSRF, CSRF, IDOR/broken access control, auth flaws, secret leakage, prompt injection, misconfiguration) by design rather than patching them later. Also use for security reviews, threat modeling, and pre-ship hardening.
How this skill is triggered — by the user, by Claude, or both
Slash command
/secure-development:secure-developmentThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A security playbook for **building things correctly the first time**. The goal is
LIFECYCLE.mdreferences/ai-llm-application-security.mdreferences/api-security.mdreferences/authentication.mdreferences/authorization-and-access-control.mdreferences/business-logic-and-abuse-security.mdreferences/cryptography-and-data-protection.mdreferences/data-privacy-and-compliance.mdreferences/database-security.mdreferences/dependency-and-supply-chain-security.mdreferences/email-security.mdreferences/infrastructure-cloud-and-container-security.mdreferences/input-validation-and-output-encoding.mdreferences/language-and-framework-pitfalls.mdreferences/logging-monitoring-and-error-handling.mdreferences/mobile-application-security.mdreferences/rate-limiting-and-abuse-prevention.mdreferences/realtime-and-websocket-security.mdreferences/secrets-management.mdreferences/secure-code-reuse-and-implementation.mdA security playbook for building things correctly the first time. The goal is secure by design: bake the right defaults into code as it's written, not bolt security on after a pentest. This file is the index — it routes you to a focused reference for whatever you're touching. Pull the specific reference(s) below into context; each is self-contained (Threats → Secure defaults → ❌/✅ code patterns → Checklist → Red flags to grep for → Tooling & CI checks).
Research across 20 categories of real-world breaches shows the same handful of root causes recur. Before writing or approving any code that touches a trust boundary, ask:
alg taken from the token, CORS
Origin reflected, an LLM's output used as a security decision, "internal" DB
values, archive entry names — all attacker-influenced. Re-derive every
security-relevant value server-side from a verified principal, and check
per-object / per-tenant / per-field authorization in the query itself.If the answer to (1) is "yes" or to (2) is "I'm trusting it," stop and fix that first — then consult the specific reference below.
threat-modeling-and-secure-design.md.
Ask: what's the trust boundary, what's the worst thing that happens here, who
is the attacker? Pick the relevant references from the routing table below.LIFECYCLE.md
— it walks the 9 build phases (plan → publish → operate), and for each phase gives
what to do, how to prevent the failure (mapped to NIST SSDF / Microsoft SDL / SLSA /
OWASP), which references to open, and the exit gate before you proceed. Includes
sector-specific steps (mobile signing, ML provenance, IoT secure-boot, OSS SLSA).If a request involves handling untrusted data, identity, secrets, or money and you
are unsure which reference applies — default to loading threat-modeling-and-secure-design.md
and input-validation-and-output-encoding.md first.
HttpOnly,
Secure, SameSite), correct CORS (never * with credentials).| If you're working on… | Read these references |
|---|---|
| Any feature taking user input | input-validation-and-output-encoding.md, web-application-vulnerabilities.md |
| A web page / frontend | web-application-vulnerabilities.md (XSS), web-security-headers-and-browser-protections.md |
| A REST/GraphQL API | api-security.md, authorization-and-access-control.md, rate-limiting-and-abuse-prevention.md |
| Login / signup / sessions / SSO | authentication.md, authorization-and-access-control.md |
| Permissions / multi-tenant / roles | authorization-and-access-control.md |
| Encryption, hashing, tokens, PII at rest | cryptography-and-data-protection.md, data-privacy-and-compliance.md |
| A database / SQL / NoSQL / ORM / data store | database-security.md, input-validation-and-output-encoding.md |
| Config, API keys, credentials | secrets-management.md |
| File uploads / archives | input-validation-and-output-encoding.md, web-application-vulnerabilities.md |
| Outbound HTTP / fetch-by-URL / webhooks | web-application-vulnerabilities.md (SSRF), api-security.md |
| Chat / notifications / live updates | realtime-and-websocket-security.md |
| LLM / chatbot / agent / RAG features | ai-llm-application-security.md |
| Payments / checkout / quotas / balances | business-logic-and-abuse-security.md, authorization-and-access-control.md |
| Sending email | email-security.md |
| Mobile app (iOS/Android) | mobile-application-security.md |
| Cloud / Terraform / Docker / Kubernetes | infrastructure-cloud-and-container-security.md, secrets-management.md |
| Adding/updating dependencies | dependency-and-supply-chain-security.md |
| CI/CD pipelines | secure-sdlc-and-devsecops.md, dependency-and-supply-chain-security.md |
| Logging / error handling / monitoring | logging-monitoring-and-error-handling.md |
| Anti-abuse / bot defense / rate limits | rate-limiting-and-abuse-prevention.md |
| Picking patterns for a specific stack | language-and-framework-pitfalls.md |
| Reusing pasted / AI-generated code, integrating snippets | secure-code-reuse-and-implementation.md |
| Anything new, at design time | threat-modeling-and-secure-design.md |
Foundations
threat-modeling-and-secure-design.md — trust boundaries, STRIDE, least privilege, fail-closed, defense in depth.input-validation-and-output-encoding.md — the root cause of injection; validate-then-encode, parameterization.language-and-framework-pitfalls.md — per-stack insecure→secure patterns (Node, Python, Java, Go, PHP, Rails, .NET, React/Angular/Vue).secure-code-reuse-and-implementation.md — insecure copy-paste, AI-generated code & slopsquatting, wrong control implementations, integration/type-confusion bugs, dead/debug code shipped to prod.Web & API
web-application-vulnerabilities.md — OWASP Top 10: XSS, injection, SSRF, CSRF, IDOR, path traversal, upload, deserialization, SSTI, request smuggling, cache poisoning.api-security.md — OWASP API Top 10: BOLA/BFLA, mass assignment, rate limiting, REST vs GraphQL, webhooks.web-security-headers-and-browser-protections.md — CSP, CORS, cookies, HSTS, clickjacking, SRI, COOP/COEP.realtime-and-websocket-security.md — CSWSH, handshake + per-message authz, realtime DoS.Identity & access
authentication.md — password hashing, MFA/passkeys, sessions, JWT, OAuth2/OIDC, account recovery.authorization-and-access-control.md — server-side enforcement, RBAC/ABAC/ReBAC, IDOR, multi-tenancy, deny-by-default.Data protection
cryptography-and-data-protection.md — TLS, AEAD, key management/KMS, CSPRNG, constant-time compare, PII.secrets-management.md — no hardcoded secrets, vaults, rotation, leak response, CI secrets.data-privacy-and-compliance.md — data minimization, GDPR/CCPA duties, retention, pseudonymization.database-security.md — least-privilege DB accounts, never-public exposure, TLS-to-DB, encryption at rest, RLS/tenant isolation, query caps, backup security.Abuse & logic
rate-limiting-and-abuse-prevention.md — algorithms, keying behind proxies, fail-closed, anti-automation.business-logic-and-abuse-security.md — idempotency, replay, race conditions, price/quantity tampering.ai-llm-application-security.md — prompt injection (direct/indirect), excessive agency, insecure output handling.Platform & delivery
infrastructure-cloud-and-container-security.md — IAM least privilege, container hardening, K8s, IaC, IMDSv2, subdomain takeover.dependency-and-supply-chain-security.md — vuln scanning, lockfiles, SBOM, signing, typosquatting.mobile-application-security.md — secure storage, cert pinning, deep links, WebView hardening (OWASP MASVS).email-security.md — SPF/DKIM/DMARC, header/SMTP injection.Operations
logging-monitoring-and-error-handling.md — security logging, no secrets in logs, error hygiene, audit trails.secure-sdlc-and-devsecops.md — shift-left, SAST/DAST/SCA, pre-commit hooks, CI security gates.Provenance: the reference set was researched, validated, and hardened against two
deep-research passes:
research/REAL-WORLD-SECURITY-RESEARCH.md
— a 20-category study of real-world developer security failures and their
cross-cutting root causes — and a separate 18-domain structured dataset whose
durable defaults, controls, detection tools, and CI checks were folded into every
reference file. The ## Real-world incidents examples were each fact-checked via
web search and adversarially re-verified; any claim that could not be corroborated
(or was exaggerated) was dropped, so only sourced, confirmed incidents remain.
Provides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.
npx claudepluginhub siam-hossain9/secure-development-skill --plugin secure-development