JavaScript security audit

Audit JavaScript code for OWASP Top 10 vulnerabilities in educational web projects.

Updated Oct 25, 2025
One-click install
npx skills add https://github.com/cynthiateeters/hap-learning-lab-template --skill javascript-security-audit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: JavaScript security audit
Source: https://github.com/cynthiateeters/hap-learning-lab-template/tree/main/.claude/skills/security-audit
Command: npx skills add https://github.com/cynthiateeters/hap-learning-lab-template --skill javascript-security-audit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill systematically analyzes JavaScript for common vulnerabilities, aligning with OWASP Top 10. It prevents security flaws like Cross-Site Scripting (XSS) and ensures educational web projects maintain strong client-side security practices.

Core Features & Use Cases

  • Input Validation: Enforces whitelist validation for all user input and external data, preventing injection attacks.
  • XSS Prevention: Guides safe HTML insertion methods, avoiding dangerous functions like innerHTML with untrusted content.
  • Dangerous Function Checks: Identifies and flags risky JavaScript patterns such as eval() or document.write().
  • Use Case: Before deploying any new interactive demo or feature, run this Skill to automatically audit your JavaScript for security flaws, ensuring your content is safe and robust.

Quick Start

Example: Check for dangerous functions before committing

grep -r 'eval(' .claude/skills/security-audit/ grep -r 'Function(' .claude/skills/security-audit/ grep -r 'document.write(' .claude/skills/security-audit/

Frequently Asked Questions about JavaScript security audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify XSS vulnerabilities in my JavaScript code?

XSS vulnerabilities occur when untrusted data is inserted into the DOM unsafely. This Skill audits your JavaScript to detect dangerous patterns like `innerHTML` with user input, unsafe DOM manipulation, and missing input validation—core OWASP Top 10 risks in educational web projects.

What JavaScript functions should I avoid for security reasons?

Functions like `eval()`, `Function()`, and `document.write()` create security risks by executing or injecting code unpredictably. This Skill flags these dangerous patterns and guides you toward safer alternatives for handling dynamic content in educational demos and games.

How can I validate user input to prevent injection attacks?

Input validation using whitelist approaches ensures only expected data formats reach your application logic. This Skill enforces whitelist validation for all user input and external data sources, blocking injection attacks before they compromise your web project.

When should I run a JavaScript security audit during development?

Run security audits before deploying new interactive features, after code edits, and whenever integrating external data or browser APIs. This Skill automates those checks for demos, calculators, and games to catch vulnerabilities early in your development cycle.

Does this audit cover OWASP Top 10 security requirements?

Yes. This Skill applies OWASP Top 10 validation, input validation, XSS prevention, safe DOM manipulation, and defense-in-depth checks to your client-side JavaScript, ensuring your educational web projects meet standard security practices.

Can I use this security audit with external data sources and browser APIs?

Yes. This Skill validates data sources and checks for unsafe browser API usage patterns. It audits how your JavaScript handles external data and API interactions to prevent vulnerabilities when integrating third-party content or platform features.