security-hardening
Skill0 starsChanged 15 days agoMITView on GitHub
Production security checklist and fixes for Express APIs — tenant isolation (404 not 403), input validation, helmet/CORS/body limits, rate limits, secrets in config only, encrypted third-party keys, SSRF guards on outbound URLs, HTML sanitization, safe uploads, webhook signature checks, error and log hygiene, and dependency hygiene. Use after writing auth, endpoints, file uploads, webhooks, outbound HTTP or anything touching user data, or before a release.
- Reads credentials
31 other projects use a version of this.
Adopted by
Most recently taken up by
- chiruu12/claude-skills-templatetheir own version, first seen Nov 29, 2026
- tanbopp/ai-development-frameworktheir own version, first seen Nov 29, 2026
- ericgandrade/agentic-sdlctheir own version, first seen Nov 29, 2026
- hi-donwi/Donwi-Skillstheir own version, first seen Nov 22, 2026
- revealui-studio/revskillstheir own version, first seen Nov 16, 2026
- RevealUIStudio/revskillstheir own version, first seen Nov 16, 2026
Used with
Projects with it also use data-engineering, observability and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
travisjneumanSkilldata-engineering
ETL/ELT pipelines, data warehousing (BigQuery, Snowflake, Redshift), stream processing (Kafka, Spark Streaming), orchestration (Airflow, Dagster, Prefect), dbt transformations, and data lake architecture. Use when building data pipelines, designing warehouse schemas, or implementing real-time data processing.
Also in 3 projects that use this
OpenAISkillobservability
Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.
Also in 6 projects that use this
AnthropicSkillincident-response
Run an incident response workflow — triage, communicate, and write postmortem. Trigger with "we have an incident", "production is down", an alert that needs severity assessment, a status update mid-incident, or when writing a blameless postmortem after resolution.
Also in 5 projects that use this
barisariburnuSkillperformance-optimization
Complete performance optimization guide for Next.js applications including frontend, backend, database, caching, and general optimization strategies. Use when improving performance, reducing bundle size, optimizing queries, or implementing caching.
Also in 6 projects that use this
GitHubSkillaccessibility-audit
Audits actual components and routes against applicable WCAG 2.2 A/AA criteria using consumer-owned design-system evidence and repository tools. Use when asked for an accessibility audit, a11y check, keyboard or focus review, contrast check, or screen-reader verification.
Also in 4 projects that use this
jarosser06Skilltest-strategy
Plans pytest test strategies for Drift's 90%+ coverage requirement using coverage analysis, edge case identification, and test suite design. Use when determining what tests to write, analyzing coverage gaps, or planning test strategies.
Also in 3 projects that use this
Other versions31 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 31
- duyet/clickhouse-monitoring★ 306same name
- DevelopersGlobal/ai-agent-skills★ 220same name
- swyxio/skills★ 203same name
- ericgandrade/agentic-sdlc★ 109same name
- mn-youssef/security-skills★ 47same name
- wulaosiji/skills★ 28same name
- khuynh22/agent-dev-team★ 9same name
- alexderz/agentic-toolbox★ 5same name
- juanitourquiza/shipframe★ 5same name
- jx1100370217/my-openclaw-skills★ 4same name
21 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository14 other files it gives its agents.
- ai-integrationSkill
- api-docsSkill
- auth-sessionsSkill
- backend-conventionsSkill
- backend-reviewSkill
- create-backendSkill
- deploy-dockerSkill
- mongoose-mongodbSkill
- new-moduleSkill
- nextjs-api-routesSkill
- prisma-postgresSkill
- redis-cacheSkill
- scheduled-jobsSkill
- session-logSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 0 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 28 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Every domain query filters by the scope field taken from req.user / resolved middleware — never from req.body or req.query.
- Very specific: line 21
Every route has validateRequest(schema, source) for body, query and params.
- Very specific: line 40
Only src/config/index.js reads process.env.
- Very specific: line 65
No new dependency for something the platform already does (crypto, fetch, net.BlockList).
“Common” is measured: kept by at least 6 in 10 of the 28 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Security Hardening
Work through each section against the code in scope. Fix what is fixable; list what needs a human decision.
1. Tenant isolation (most common real bug)
- Every domain query filters by the scope field taken from
req.user/ resolved middleware — never fromreq.bodyorreq.query. - Lookups by id include the scope:
findOne({ _id, storeId })/findFirst({ where: { id, orgId } }). Id-only lookups are an IDOR. - Another tenant's resource → 404, so existence is not confirmed. Same for non-members of an org/project.
- Updates/deletes use scoped filters (
updateMany({ where: { id, orgId } })) so a guessed id cannot touch another tenant. - List endpoints for non-admin roles filter to what the caller may see, not "everything in the org".
- Public/share endpoints return an explicit allowlist of fields; never owner email, ids of private records or settings.
2. Input
- Every route has
validateRequest(schema, source)for body, query and params. Zod strips unknown keys by default — keep it that way; never spreadreq.bodyinto a write without a schema. - Strings have
max(); arrays havemax(); numbers have bounds; ids have a format. - Mass-assignment: fields like
role,isActive,storeId,plan,ownerIdare never accepted from clients on ordinary endpoints. - User text used in
$regexis escaped; Mongo filters never take raw objects from the client (operator injection:{ "$gt": "" }). - Size limits at the edge:
express.json({ limit })sized to the largest legitimate payload, plus explicit domain limits (e.g. reject a document over N MB before the database rejects it).
3. Transport and headers
helmet()on;app.disable('x-powered-by');trust proxyset to the real number of proxies.- CORS: explicit origin allowlist from config with
credentials: true. Never*with credentials. - Cookies carrying auth:
httpOnly,Securein production,SameSite=Strict, narrowpath. - Webhook routes that verify signatures use
express.raw()beforeexpress.json()and compare HMACs withcrypto.timingSafeEqual.
4. Rate limits
Redis-backed so they hold across instances: coarse per-IP, strict on credential endpoints, per-user on writes and expensive routes (AI, exports, email sends). Numbers come from config. See redis-cache.
5. Secrets
- Only
src/config/index.jsreadsprocess.env; required secrets fail boot when missing. .envis gitignored;.env.examplehas every key with placeholders. Search the diff for keys, tokens and connection strings before committing.- Third-party credentials stored on behalf of users (API keys, OAuth tokens) are encrypted with AES-256-GCM (
secret-box.jsinai-integration), shown only as last-4. - Tokens stored server-side are hashed (sha256), not kept in plain text.
6. Outbound requests
- Any URL a user can influence (webhooks, AI base URLs, image fetches, link previews) goes through an SSRF guard: https only, resolved IP not private/loopback/link-local/metadata, checked at call time.
- Outbound calls have timeouts and no automatic retries on non-idempotent requests.
7. Output and content
- User-supplied HTML (rich text) is sanitized server-side with an allowlist (
sanitize-html); never trust client sanitization. - Private files are stored by path and served as short-lived signed URLs built at response time, never public URLs. Accept a file reference only if it was uploaded by this tenant recently or is already attached in the same tenant.
- Sensitive fields (
password,tokenHash,phone, key ciphertext) are excluded by explicitselect, not by deleting after fetch.
8. Errors and logs
- Clients see 4xx messages and a generic 5xx message; stacks only outside production.
- Logs never contain passwords, tokens, API keys, cookies, full request bodies on auth routes, or AI prompt/completion text unless the product stores it by design.
- Security events (
token rejected,refresh reuse, repeated failed sign-in) uselogger.securitywithrequestIdanduserId.
9. Dependencies
npm audit --omit=dev; upgrade or justify every high/critical.- No new dependency for something the platform already does (
crypto,fetch,net.BlockList).
Report format
[CRITICAL] IDOR on getInvoice — src/modules/invoice/services/invoice.service.js:42
findFirst({ where: { id } }) has no orgId. Fixed: added orgId + isActive.
[HIGH] Missing rate limit on POST /v1/auth/forgot-password — needs config value (manual)CRITICAL blocks release. HIGH should be fixed before release. List manual items separately.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

