node-typescript-security-pitfalls

node-typescript-security-pitfalls is a skill for Claude Code, Codex from makifbaysal/tasktrooper. It costs 53 tokens per session (1,739 once invoked), scanned A, original, Apache-2.0.

A security review guide for Node.js and TypeScript server code, including Express, Fastify, Nest, and Next.js server endpoints. It covers the gap between declared TypeScript types and the values that arrive at runtime.

In plain words
What is it for?
Use it to review request validation, child processes, raw database queries, prototype pollution, templates, JWT handling, outbound HTTP clients, and public server actions or routes.
Why use it?
Requests can contain arrays or objects even when the code says a value is a string, and server code can also expose command, query, template, token, or outbound-request risks.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to review request validation, child processes, raw database queries, prototype pollution, templates, JWT handling, outbound HTTP clients, and public server actions or routes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/makifbaysal/tasktrooper/node-typescript-security-pitfalls
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add makifbaysal/tasktrooper --skill node-typescript-security-pitfalls
Clone the repo
git clone --depth 1 https://github.com/makifbaysal/tasktrooper

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for node-typescript-security-pitfalls

README.md
[![agentmods](https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/node-typescript-security-pitfalls/github.svg)](https://agentmods.dev/skills/makifbaysal/tasktrooper/node-typescript-security-pitfalls)
Your own site
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/node-typescript-security-pitfalls"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/node-typescript-security-pitfalls/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for node-typescript-security-pitfalls

Your own site · 80×15
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/node-typescript-security-pitfalls"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/node-typescript-security-pitfalls.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,739 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00053 $0.01739
Opus 5.5 $0.00021 $0.00696
Sonnet 5.5 $0.00011 $0.00348
Haiku 4.5 $0.00005 $0.00174

Measured 4d ago against content hash 4922efce063e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

node-typescript-security-pitfalls scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

description: Use when reviewing Node.js or TypeScript server code - Express/Fastify/Nest handlers, Next.js server actions and route handlers, child_process, ORM raw queries, prototype pollution, template engines, JWT and
catalog/agents/security-agent/skills/node-typescript-security-pitfalls/SKILL.md · 124 lines

How it starts

The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Node and TypeScript Security Pitfalls

Overview

TypeScript types vanish at runtime: req.query.id: string can arrive as an array or an object. Most Node findings come from that gap, from exec with a template string, from raw-query escape hatches in otherwise safe ORMs, and — in Next.js — from forgetting that a server action is a public endpoint.

1. Runtime Types Are Not Declared Types

// ❌ ?id[$ne]=x or ?id[]=a&id[]=b gives an object or array, not a string
const doc = await Orders.findOne({ id: req.query.id as string, owner: user.id });
// ✅ validate at the boundary (zod/valibot/class-validator) and coerce
const { id } = z.object({ id: z.string().uuid() }).parse(req.query);

Length, includes and equality checks on an unvalidated query value can be bypassed the same way.

2. child_process (CWE-78, CWE-88)

// ❌ shell
exec(`convert ${file} out.png`);
spawn("git", ["clone", url], { shell: true });
// ✅ no shell, end of options
execFile("git", ["clone", "--", url, dir]);

Also check the env option for request-controlled keys (NODE_OPTIONS=--require …).

3. Raw Queries in Safe ORMs (CWE-89)

Library Unsafe Safe
Prisma $queryRawUnsafe, $executeRawUnsafe, Prisma.raw() $queryRaw tagged template, model methods
TypeORM query("… " + x), .where(\id = ${id}`)` .where("id = :id", { id })
Sequelize sequelize.query(\… ${x}`), literal(x)` replacements / bind
Knex knex.raw(\… ${x}`)` knex.raw("… ?", [x])
Drizzle sql.raw(x) sql\… ${x}``

Mongo/Mongoose: operator injection from JSON bodies (section 1), $where.

4. Next.js Server Actions and Route Handlers

  • Every exported async function in a "use server" file is a callable POST endpoint, whether or not a page renders a form for it. Each must authenticate and authorize inside the action.
// ❌ the page is admin-only, the action is not
"use server";
export async function deleteUser(id: string) { await db.user.delete({ where: { id } }); }
// ✅
export async function deleteUser(id: string) {
  const session = await auth();
  if (session?.user.role !== "admin") throw new Error("forbidden");
  await db.user.delete({ where: { id } });
}

Read the full file on GitHub · 124 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 124 lines · 53 tokens per session scan A 4922efce063e

Subscribe to this mod's changes

node-typescript-security-pitfalls is a skill published in the GitHub repository makifbaysal/tasktrooper (113 stars, last pushed yesterday), licensed Apache-2.0. It adds 53 tokens to every session and 1,739 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-09.