javascript-sast

A security scanner for JavaScript and Node.js projects that checks third-party packages and searches source code for several unsafe patterns.

In plain words
What is it for?
Use it when a project has JavaScript package files to run an npm dependency audit and inspect matches such as eval, unsafe HTML insertion, and document.write.
Why use it?
It helps identify vulnerable dependencies and code that may enable cross-site scripting, dynamic code execution, or prototype pollution.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/vladkesler/initrunner/javascript-sast
Any agent
npx skills add vladkesler/initrunner --skill javascript-sast
Clone the repo
git clone --depth 1 https://github.com/vladkesler/initrunner

Made for: Claude Code, Codex.

Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 532 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00031 $0.00532
Opus 5 $0.00015 $0.00266
Sonnet 5 $0.00006 $0.00106
Haiku 4.5 $0.00003 $0.00053

Measured 2d ago against content hash 43a0e8899a6a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

javascript-sast scanned grade A with 0 findings 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 2d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

examples/roles/security-scanner/skills/javascript-sast/SKILL.md · 79 lines

How it starts

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

JavaScript and Node.js security scanning skill.

When to activate

Use this skill when the repository contains package.json or package-lock.json.

Scanner commands

Dependency audit

npm audit --json 2>/dev/null

Returns advisories with severity, module_name, title, url, and findings[].paths showing which dependencies pull in the vulnerable package.

Source pattern scan

rg -n 'eval\(|innerHTML\s*=|dangerouslySetInnerHTML|document\.write\(' \
  --glob '*.{js,ts,jsx,tsx}' \
  --glob '!node_modules/**' \
  --glob '!*.test.*' \
  --glob '!*.spec.*'

Parsing npm audit output

The JSON output contains an advisories object keyed by advisory ID. Each advisory has:

  • severity -- critical, high, moderate, low
  • module_name -- the vulnerable package
  • title -- vulnerability description
  • url -- link to the advisory
  • findings[].paths -- dependency paths that include this package

Focus on production dependencies. Skip devDependency-only findings.

Verification

For source pattern matches, read 10-15 lines of surrounding context:

  1. Is the argument to eval() a variable or a constant string?
  2. Is innerHTML assigned from user input, URL params, or API response?
  3. Is there DOMPurify or other sanitization before the assignment?
  4. For prototype pollution: is there a recursive merge without hasOwnProperty check on user-supplied objects?

MUST flag

  • eval() with variables (not constant strings)
  • innerHTML assigned from user input, URL params, or API response without sanitization
  • Prototype pollution patterns (recursive merge without hasOwnProperty)
  • Missing CSRF protection on state-changing routes
  • Production dependency advisories with severity high or critical

MUST NOT flag

  • eval in build configs (webpack.config.js, babel.config.js, jest.config.js, vite.config.ts)
  • innerHTML with DOMPurify-sanitized content
  • dangerouslySetInnerHTML with compile-time constants
  • devDependency-only audit findings (not in production bundle)
  • Test and spec files

Read the full file on GitHub · 79 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. 2d ago First seen · 79 lines · 31 tokens per session scan A 43a0e8899a6a

Subscribe to this mod's changes

javascript-sast is a skill published in the GitHub repository vladkesler/initrunner (41 stars, last pushed 4d ago), licensed Apache-2.0. It adds 31 tokens to every session and 532 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.