agentsclimarketplace

Security antipatterns javascript

Skill subhashdasyam/security-antipatterns-javascript

Skill that teaches AI coding agents to write secure JavaScript. Catches SQL injection, XSS, prototype pollution, and OWASP Top 10 patterns in Express, Next.js, and Node.

Install
npx -y skills add subhashdasyam/security-antipatterns-javascript

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Code generation guard for Node.js/TypeScript/Next.js - prevents OWASP Top 10 vulnerabilities while writing code

SKILL.md

4.6 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

Security Anti-Patterns Guard for Node.js/TypeScript/Next.js

When to Activate

Activate this skill when generating ANY code involving:

  • Node.js backend code
  • TypeScript applications
  • Next.js (App Router or Pages Router)
  • Express/Fastify APIs
  • Database queries (Prisma, Drizzle, raw SQL, MongoDB)
  • Authentication/authorization logic
  • File uploads or user input handling
  • API endpoints or Server Actions

Critical Rules (Top 10)

  1. NEVER use string concatenation for SQL/NoSQL queries - use parameterized queries or ORM methods
  2. NEVER use dangerouslySetInnerHTML with user input without DOMPurify sanitization
  3. ALWAYS verify resource ownership (BOLA) - where: { id, userId: session.user.id }
  4. ALWAYS validate ALL external input with zod/yup at API boundaries
  5. NEVER hardcode secrets - use process.env (not NEXT_PUBLIC_* for secrets)
  6. ALWAYS use crypto.randomBytes() or crypto.randomUUID() - never Math.random() for security
  7. NEVER trust middleware alone for auth - verify in route handlers (defense in depth)
  8. ALWAYS hash passwords with bcrypt/argon2 - never MD5/SHA1/unsalted
  9. NEVER use exec() with user input - use execFile() with argument arrays
  10. ALWAYS validate file uploads: extension, MIME type, size limits

Module Index

Reference these modules for specific vulnerability patterns:

ModuleCoversOWASP Reference
injection.mdSQL, Command, NoSQL, Template, LDAP injectionA03:2021
xss-output.mdXSS (Reflected, Stored, DOM), output encodingA03:2021
auth-access.mdBOLA, BFLA, auth, sessions, JWTAPI1-3, API5
crypto-secrets.mdSecrets management, encryption, hashingA02:2021
input-validation.mdValidation, mass assignment, path traversal, uploadsA03:2021, API3
prototype-pollution.mdJS prototype pollution attacksCWE-1321
typescript-safety.mdType safety gaps, runtime validationCWE-843
nextjs-security.mdMiddleware bypass, Server Actions, SSRFCVE-2025-29927, CVE-2025-66478
rsc-security.mdRSC deserialization (React2Shell), DoS, Server Action abuseCVE-2025-55182, CVE-2025-55184
api-infra.mdRate limiting, CORS, headers, error handlingAPI4, API6-7
dependencies.mdSupply chain, slopsquatting, NPM malware, PhantomRavenA06:2021, CWE-506
nodejs-runtime.mdReDoS, async hooks exhaustion, HTTP/2 DoS, child processesCWE-1333, CVE-2025-59466

How to Use This Skill

When generating code:

  1. Identify applicable modules based on what you're writing
  2. Reference the specific module for detailed BAD/GOOD patterns
  3. Apply the GOOD pattern - never generate code matching BAD patterns
  4. Verify the output against the Critical Rules above

Quick Reference by Task

Writing...Reference
Database queriesreferences/injection.md, references/input-validation.md
API route/endpointreferences/auth-access.md, references/api-infra.md, references/input-validation.md
User authenticationreferences/auth-access.md, references/crypto-secrets.md
Form handlingreferences/input-validation.md, references/xss-output.md
File operationsreferences/input-validation.md, references/nodejs-runtime.md
Next.js Server Actionsreferences/nextjs-security.md, references/rsc-security.md, references/auth-access.md
React Server Componentsreferences/rsc-security.md, references/nextjs-security.md
Third-party package usagereferences/dependencies.md
Rendering user contentreferences/xss-output.md
Environment/configreferences/crypto-secrets.md
Child processesreferences/nodejs-runtime.md, references/injection.md

Response Format

When this skill is active, ensure generated code:

  1. Includes necessary imports (zod, bcrypt, etc.)
  2. Shows the secure pattern being used
  3. Includes brief comments explaining security measure if non-obvious
  4. Does NOT include insecure alternatives "for reference"

What ships with it: 14 files

82.5 KB alongside SKILL.md

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.