Javascript sast

From vladkesler/initrunner · View interactive version

Javascript sast is an AI agent skill from the GitHub repository vladkesler/initrunner. JavaScript and Node.js security scanning. Checks dependency vulnerabilities via npm audit and source patterns for XSS, eval, and prototype pollution.

How to use this skill

Skill file

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:

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

without sanitization

MUST NOT flag

jest.config.js, vite.config.ts)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.