Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

typescript-security

БесплатноБез исполняемых скриптовНе проверен

Guideline for designing, implementing, and verifying secure TypeScript and JavaScript applications following OWASP Top 10 best practices. Use when the user…

jim60105от jim60105★ 22 звезды на GitHub

Об этом скилле

TypeScript / JavaScript Security Development Guide

Provide a structured approach to building secure TypeScript and JavaScript applications, covering the OWASP Top 10, secure coding patterns, and verification checklists. Apply these guidelines throughout the secure development lifecycle — from threat modeling through deployment. This guide covers both server-side (Node.js, Deno, Bun) and client-side (browser) contexts.

Secure Development Lifecycle

Phase 1: Threat Modeling and Secure Design

Before writing code, identify and mitigate threats at the design level:

  • Identify trust boundaries — Map where untrusted data enters the system (HTTP requests, WebSocket messages, file uploads, database reads, environment variables, third-party APIs, postMessage, URL parameters, localStorage)
  • Map data flows — Trace sensitive data (credentials, PII, tokens) through the system and verify protection at each stage
  • Enumerate entry points — List all routes, endpoints, CLI arguments, message queue consumers, WebSocket handlers, and scheduled tasks
  • Map attack surfaces to OWASP Top 10 — Cross-reference each entry point against the OWASP categories in the quick reference table below

Design with security controls built-in:

  • Centralized authentication and authorization middleware — never scatter auth checks across handlers
  • Input validation at every trust boundary — validate early, reject invalid data before processing
  • Least-privilege database access — use read-only connections where writes are not needed
  • Defense in depth — layer multiple controls (input validation + parameterized queries + WAF)
  • Fail securely — deny by default, require explicit grants
  • Server-side enforcement — never rely solely on client-side validation or access controls

Phase 2: Secure Implementation

Critical Prohibitions

Never use these patterns. Violations are high-severity findings in any review.

Never Instead
eval() / Function() constructor with untrusted input JSON.parse() or a dedicated parser
child_process.exec() with user input child_process.execFile() or spawn() with array args
String concatenation / template literals in SQL Parameterized queries (db.query(sql, params))
innerHTML / outerHTML / document.write() with untrusted data textContent, framework templating, or DOMPurify
dangerouslySetInnerHTML with unsanitized data DOMPurify + explicit sanitization
Math.random() for security purposes crypto.randomUUID() / crypto.getRandomValues()
MD5 / SHA1 for password hashing bcrypt, argon2, or scrypt via crypto.scrypt()
== for security comparisons === strict equality
Object.assign() / spread with untrusted input on prototypes Validated schema (Zod, class-validator) + Object.create(null)
require() / import() with user-controlled paths Static imports with allowlisted modules
Hardcoded secrets in source code Environment variables or secret manager (Vault, AWS SM)
NODE_ENV !== 'production' left in production Environment-specific configuration
JSON.parse() without schema validation on untrusted data Zod, io-ts, or class-validator after parsing
new RegExp(userInput) Escape user input or use a safe regex library
vm.runInNewContext() / vm.runInThisContext() with untrusted code Isolated worker threads or dedicated sandbox
Disabling TLS verification (rejectUnauthorized: false) Proper certificate management

Secure Implementation References

Phase 3: Security Verification

Apply a layered verification approach:

  1. Static Analysis — Detect common vulnerability patterns automatically
    • eslint-plugin-security — Node.js security linter rules
    • eslint-plugin-no-unsanitized — Detect unsafe DOM manipulation
    • semgrep — Pattern-based analysis with OWASP and TypeScript/JavaScript rulesets
    • typescript-eslint — Type-aware linting for TypeScript
  2. Dependency Audit — Identify known vulnerabilities in third-party packages
    • npm audit / yarn audit / pnpm audit — Built-in package manager auditing
    • snyk — Comprehensive vulnerability database and remediation advice
    • socket.dev — Supply chain attack detection (typosquatting, install scripts)
  3. Secrets Detection — Find leaked credentials and API keys
    • detect-secrets — Baseline-aware secrets scanner
    • gitleaks — Git-aware secrets scanning
  4. Code Review — Apply the security review workflow and checklists
  5. Security Testing — Write negative tests that verify rejection of malicious inputs; fuzz-test
Полный SKILL.md на GitHub

Установить typescript-security в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/owasp-top-10.mdreferences/secure-coding.mdreferences/security-checklist.md

FAQ

Что делает скилл typescript-security?

Guideline for designing, implementing, and verifying secure TypeScript and JavaScript applications following OWASP Top 10 best practices. Use when the user wants to: (1) review TypeScript or JavaScript code for security vulnerabilities, (2) design a secure Node.js, Deno, or browser application architecture, (3) implement security features (authentication, authorization, cryptography, input validation), (4) audit npm/yarn/pnpm dependencies for known vulnerabilities, (5) create security checklists or verification plans, (6) fix security bugs or harden existing TypeScript or JavaScript code, (7) set up security testing and static analysis (ESLint security plugins, Semgrep, Snyk), or (8) handle any TypeScript/JavaScript security concern including injection prevention, prototype pollution, XSS protection, SSRF prevention, secrets management, and secure deployment.

Как установить скилл typescript-security?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл typescript-security запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить typescript-security с