agentleFS
NoorQureshiNoorQureshi/SploitAgent/skills/code-review/code-review-nodejs/SKILL.md

code-review-nodejs

Skill26 starsChanged 31 days agoMITView on GitHub

Security review of Node.js / JavaScript code — dangerous sinks and Express/framework pitfalls. Load when reviewing a Node/JS codebase/PR, on package.json + Express/Next/Nest, or "review this Node app". Signals: child_process, eval, Function, prototype pollution, JWT, Mongoose/Sequelize.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Node.js / JavaScript security code review

When it applies

Reading Node/JS source (Express, Next.js, NestJS, a package). Language companion to code-review-methodology — the exact sinks and framework gotchas to grep and trace.

Sinks & patterns (grep, then trace to user input)

  • Command exec: child_process.exec/execSync with user input (use execFile/spawn w/ arg array); template strings in commands.
  • Code eval: eval, new Function, vm.runIn…, setTimeout("string") — RCE.
  • Prototype pollution: recursive merge/Object.assign/lodash.merge/set, JSON.parse into object merges, query parsers — __proto__/constructor keys (→ web-prototype-pollution).
  • SQL/NoSQL: string-built SQL; Mongo queries taking raw req.body/req.query (operator injection {$gt:''}); Sequelize .query()/literal.
  • SSRF: axios/fetch/http.get/request on a user URL.
  • Path/upload: fs.readFile/sendFile/path.join with user paths; res.sendFile traversal.
  • XSS (server + client): res.send of unescaped input; DOM sinks innerHTML, document.write, dangerouslySetInnerHTML (React), v-html (Vue).
  • Deserialization: node-serialize/funcster (unserialize RCE), untrusted JSON→object merge.

Framework specifics

  • Express: missing helmet/CSP, over-broad cors(), req.query/req.params into sinks, weak session secret, no per-object authz (IDOR/BOLA), app.use order bypassing auth middleware.
  • JWT: jsonwebtoken with algorithms not pinned (alg confusion / none), weak secret (→ web-auth-jwt), secret in code.
  • Next.js/SSR: getServerSideProps trusting client input; API routes missing auth; SSRF in image/proxy.
  • Mass assignment: spreading req.body into a model/create (→ api-mass-assignment).

Method

rg -n "child_process|eval\(|new Function|innerHTML|dangerouslySetInnerHTML|\.merge\(|__proto__|node-serialize"; run njsscan . and semgrep --config auto; trace user input to each sink.

Gotchas

  • Client-side innerHTML/v-html = DOM XSS even in a "backend" review — check the front-end too.
  • Mongo operator injection needs input validation/casting, not just parameterization.

References

njsscan; Semgrep JS/TS rules; OWASP Node.js & NodeGoat; Express security best practices.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.