/engineering-paved-path:securityfrom engineering-paved-path
Web application security best practices based on OWASP Top 10:2025. Use when reviewing code for vulnerabilities, implementing auth/authorization, handling user input, working with file uploads, managing secrets, or building API endpoints. Covers React, Express, MongoDB, and JWT security.
Ships in engineering-paved-path. 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.
Security guidance for React + Express + MongoDB + JWT stacks. See examples.md for unsafe/safe code pairs, checklists.md for quick checklists, references.md for all sources.
Before flagging any issue, trace the data flow and confirm the input source.
| Confidence | Criteria | Action |
|---|---|---|
| HIGH | Vulnerable pattern + attacker-controlled input confirmed | Report with file, line, exploit, and fix |
| MEDIUM | Vulnerable pattern, input source unclear | Note for manual verification |
| LOW | Theoretical / best-practice deviation | Do not report — mention only if asked |
Do NOT flag: test files, dead code, server-controlled values (env vars, config constants), framework-mitigated patterns (React JSX escaping, Mongoose parameterized queries), development-only code gated by NODE_ENV.
Golden rule:
fetch(process.env.API_URL)= safe.fetch(req.query.url)= vulnerable. Always ask: "Can an attacker control this value?"
| # | Category | Key Risk in This Stack |
|---|---|---|
| A01 | Broken Access Control | Missing auth middleware, IDOR, no ownership checks |
| A02 | Security Misconfiguration | Helmet disabled, CORS wildcard, stack traces in prod |
| A03 | Supply Chain Failures | Compromised npm packages, typosquatting |
| A04 | Cryptographic Failures | Weak JWT secret, low bcrypt cost, hardcoded secrets |
| A05 | Injection | MongoDB operator injection, XSS, command injection |
| A06 | Insecure Design | Missing rate limiting, no threat model |
| A07 | Authentication Failures | jwt.decode() instead of verify(), brute force |
| A08 | Integrity Failures | Mass assignment via req.body spread, unvalidated uploads |
| A09 | Logging Failures | Passwords in logs, missing auth event audit trail |
| A10 | Exceptional Conditions | Fail-open auth, stack trace leaks, missing async error handling |
auth middleware as a barrier (via router.use(auth)) rather than per-route to prevent omissionsresource.author.toString() === req.user.userId plus admin role escape hatchcrossOriginResourcePolicy: 'cross-origin' for uploads. If CSP disabled, implement custom CSP restricting script-src to 'self'credentials: true. Never origin: '*' or origin: true with credentialsNODE_ENV === 'development'VITE_* prefixed vars are public in the client bundle — never put secrets thereserverSelectionTimeoutMSnpm audit before every release. Commit package-lock.json always.expres vs express)process.env.JWT_SECRETalgorithm: 'HS256' and expiresIn. Never allow none algorithmjwt.verify(), never jwt.decode() (decode doesn't check signature)Strict-Transport-Security header via HelmetString(req.body.email) — neutralizes operator objects like { "$gt": "" }$where, $expr, or $function (server-side JS execution)str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'))mongo-sanitize to strip $ keysdangerouslySetInnerHTML without DOMPurify sanitization (allowlist tags/attributes)href/src — reject javascript: protocol, allow only http:/https:exec() or spawn({ shell: true }) with user inputexecFile() which passes arguments directly without shell interpretationRate limiting strategy:
| Endpoint | Limit | Window |
|---|---|---|
| Login | 5 req | 15 min |
| Comments | 5 req | 1 min |
| AI generation | 3 req | 1 min |
| File upload | 10 req | 1 min |
| General API | 100 req | 1 min |
isApproved flag)isActive: true, compare with bcrypt, return generic "Invalid credentials" for both wrong email and wrong password (prevents enumeration){ userId, email, name, role } — minimum viableBearer <token> from Authorization headernext() only called on successful jwt.verify(). Missing return before error response = fail-open vulnerabilityloginLimiter on login endpoint (5 attempts / 15 min)pre('save') hook only if modified, comparePassword instance method, toJSON strips password from all responsesreq.body — never Model.create(req.body) (attacker can set role: 'admin')enum for fixed values, required on mandatory fields, minlength/maxlength, strict: true (default)script-src, frame-ancestors 'none', object-src 'none'Log these: Login success/failure, token rejection, admin actions, file uploads, rate limit hits, 5xx errors, 403 denials Never log: Passwords, JWT tokens, API keys, credit cards, SSNs
password, token, secret, authorization) before logging — replace with ***catch blocks must return error response before any next() call(err, req, res, next). Return generic message in production.asyncHandler to catch Promise rejections — eliminates need for try-catch in every controllerserverSelectionTimeoutMS: 5000, process.exit(1) on connection failureapp.use('*', ...))['image/jpeg', 'image/png', 'image/gif', 'image/webp'] — whitelist, not blacklist5 * 1024 * 1024 (5MB) via multer.limitsblog-{timestamp}-{random9digits}.{ext}) — never user-providedpath.basename() to strip directory components. Validate path.resolve() starts with upload directory before deletioncrossOriginResourcePolicy: 'cross-origin' for static files, no directory listingScan for these patterns in all code and config:
| Type | Pattern |
|---|---|
| AWS Key | AKIA[0-9A-Z]{16} |
| Google API | AIza[0-9A-Za-z_-]{35} |
| JWT/Generic | (secret|key|token|password)\s*[:=]\s*['"][^'"]{8,} |
| MongoDB URI | mongodb(\+srv)?://[^:]+:[^@]+@ |
| Private Key | -----BEGIN .* PRIVATE KEY----- |
| GitHub Token | gh[ps]_[A-Za-z0-9]{36,} |
| npm Token | npm_[A-Za-z0-9]{36} |
| Slack Token | xox[bpsa]-[0-9a-zA-Z-]+ |
Never commit: .env, .env.local, .env.production, logs/, uploads/
Relevant to AI content generation features (Gemini API):
__proto__/constructor.prototype — validate object keysJSON.parse() throws on malformed input — always wrap in try-catchRegExp(userInput) enables ReDoS — escape special characterspath.join() with user input allows traversal — use path.basename() firstsetTimeout(string) is implicit eval — always pass a function{ password: { "$gt": "" } } — cast to String()$where clause = server-side JS execution — never use with user input.limit() and .skip()strict: false accepts arbitrary fields — keep default strict: truedangerouslySetInnerHTML bypasses escaping — require DOMPurifyhref={userUrl} allows javascript: XSS — validate protocolVITE_* env vars are public — never prefix secretsrouter.use(auth) placed after unprotected routesreq.query values are always strings — validate and cast typesnext breaks error handlingtrust proxy behind reverse proxy — otherwise rate limiter gets wrong IP| Severity | Criteria | Stack Examples |
|---|---|---|
| CRITICAL | Direct exploit, no auth required | NoSQL injection auth bypass, hardcoded prod secrets, missing auth on admin endpoint, RCE |
| HIGH | Exploitable with conditions | Stored XSS in blog content, IDOR on delete, JWT with weak secret, passwords in logs |
| MEDIUM | Specific conditions, limited impact | Missing rate limiter, CORS misconfiguration, verbose prod errors, missing input validation |
| LOW | Defense-in-depth | Low bcrypt cost, missing security event logging, sequential ObjectId exposure |
Level 1 (All Apps): 12+ char passwords, breached list check, login rate limiting, 128+ bit session entropy, HTTPS, server-side validation, generic error messages
Level 2 (Sensitive): + MFA for sensitive ops, crypto key management, comprehensive security logging, schema-based input validation, CSRF protection
Level 3 (Critical): + HSM key storage, documented threat model, anomaly detection, penetration testing, supply chain verification
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub yamchinsky/dev-digest-ai-marketplace --plugin engineering-paved-path12 skills in this plugin
/frontend-architectureFolder structure and code organization for React + Next.js (App Router) projects. Use this skill whenever the user asks where files should live (components, hooks, utils, helpers, lib, services, constants, types), how to break a component into smaller pieces, how to organize a feature folder, where to put business logic, when to use a barrel index, or how to lay out app/ in Next.js (route groups, private folders). Trigger on phrases like 'folder structure', 'project structure', 'where should I put', 'how to organize', 'where do constants go', 'utils vs helpers', 'app router structure'. Covers organization decisions only — NOT React hook rules or render patterns (use engineering-paved-path:react-best-practices) and NOT Next-specific runtime behavior (use engineering-paved-path:next-best-practices)./mermaid-diagramCreate Mermaid diagrams in markdown. Use when the user wants to visualize workflows, architectures, API flows, data models, state machines, or system designs. Covers flowcharts, sequence diagrams, class diagrams, ER diagrams, state diagrams, and more./nestjs-best-practicesNestJS application patterns for TypeScript backends — modules and providers, dependency injection and injection tokens, the composition root, thin controllers, guards/interceptors/pipes/filters and their execution order, validation at the edge, ConfigModule and typed configuration, lifecycle hooks, exception filters, and testing with Test.createTestingModule. Use when building, wiring, reviewing or debugging a NestJS application: adding a module or a provider, resolving 'Nest can't resolve dependencies of X', choosing an injection scope, registering a global guard, shaping an error response, writing a testing module, or upgrading a NestJS major. Trigger terms: NestJS, Nest, @nestjs/common, @nestjs/core, app.module.ts, @Module, @Injectable, @Controller, provider, injection token, forwardRef, ValidationPipe, exception filter, APP_GUARD, Test.createTestingModule, nest build, nest start. NestJS runtime and wiring ONLY — NOT which layer a file belongs to (use engineering-paved-path:onion-architecture), NOT TypeORM query, migration or entity mechanics (use engineering-paved-path:typeorm-patterns), NOT PostgreSQL schema design (use engineering-paved-path:postgresql-table-design), NOT Zod schema mechanics (use engineering-paved-path:zod).Other plugins' skills for the same job
14 plugins ship this exact skill · first indexed Jul 20, 2026
Showing 6 of 14 plugins, one per repository first