Skip to content
Back to skills

Node Antipatterns

ASecurity

Forbidden Node.js backend patterns — prototype pollution, shell injection, path traversal, ReDoS, sync I/O in handlers. Applies when editing JS/TS Node files.

  • 5 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added October 21, 2026
ai-agentsgoshellnodeexpressbackendsecurity

Security analysis

A100/100

Pro scans all 15 files and shows the line behind each finding

Scanned October 21, 2026

npx -y skills add emgiezet/aisdlc --skill node-antipatterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Node Antipatterns?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Node Antipatterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/emgiezet-node-antipatterns/badge)](https://www.skillsdirectory.com/skills/emgiezet-node-antipatterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: node-antipatterns
description: Forbidden Node.js backend patterns — prototype pollution, shell injection, path traversal, ReDoS, sync I/O in handlers. Applies when editing JS/TS Node files.
paths: ["**/*.cjs","**/*.js","**/*.mjs","**/*.ts"]
user-invocable: false
---

# Node.js anti-patterns — do not write these

Checks run automatically after each edit. Findings reference the IDs below.

## Blockers
- AP-NODE-SEC-001 — Validate schemas before merging user objects; use `Object.create(null)` for hash maps.
- AP-NODE-SEC-002 — Use `execFile`/`spawn` with an argv array; never `exec` with a template literal.
- AP-NODE-SEC-004 — Avoid nested quantifiers in regexes; never construct `RegExp(userInput)` without length limits.
- AP-NODE-SEC-006 — Use `crypto.randomBytes(32)` or `crypto.randomUUID()` for tokens; never `Math.random()`.
- AP-NODE-SEC-009 — Always pass `{ algorithms: ['HS256'] }` (or your chosen alg) to `jwt.verify`.

## Errors
- AP-NODE-SEC-003 — Resolve paths with `path.resolve`, then verify the prefix matches your base directory.
- AP-NODE-SEC-005 — Compare secrets with `crypto.timingSafeEqual`; never `===` for HMAC or token values.
- AP-NODE-SEC-007 — Set `express.json({ limit: '1mb' })` and apply `helmet()` for security headers.
- AP-NODE-PERF-001 — Use async I/O (`fs.promises.*`, `util.promisify`) and async crypto in all request handlers.

## Warnings
- AP-NODE-PERF-002 — Limit JSON body size at the middleware layer; offload large payloads to a worker thread.
- AP-NODE-PERF-003 — Offload CPU-intensive work to `worker_threads`; limit parallel `fs.*` concurrency.
- AP-NODE-MAINT-001 — Register `process.on('unhandledRejection')` and `uncaughtException` handlers for graceful shutdown.

Details for any ID: `reference/<ID>.md`

Files in this skill

  • SKILL.md1.8 KB
  • reference/AP-NODE-MAINT-001.md751 B
  • reference/AP-NODE-MAINT-002.md860 B
  • reference/AP-NODE-PERF-001.md863 B
  • reference/AP-NODE-PERF-002.md771 B
  • reference/AP-NODE-PERF-003.md914 B
  • reference/AP-NODE-SEC-001.md933 B
  • reference/AP-NODE-SEC-002.md735 B
  • reference/AP-NODE-SEC-003.md881 B
  • reference/AP-NODE-SEC-004.md984 B
  • reference/AP-NODE-SEC-005.md845 B
  • reference/AP-NODE-SEC-006.md630 B
  • reference/AP-NODE-SEC-007.md829 B
  • reference/AP-NODE-SEC-008.md785 B
  • reference/AP-NODE-SEC-009.md707 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.