Skip to main content
skill CX Codex

typescript-security-review — Claude Code skill: install & review

Reviews TypeScript and Node.js codebases for OWASP Top 10 vulnerabilities, leaked secrets, and authentication bugs. Useful before production releases in Express, NestJS, or Next.js apps.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add giuseppe-trisciuoglio/developer-kit --skill typescript-security-review -a claude-code
Open on GitHub

What typescript-security-review does

The skill performs a structured security review using Read, Edit, Grep, Glob, and Bash. It starts by identifying sensitive code in authentication flows and API routes. Then it checks for SQL injection in unparameterized queries, missing input validation schemas (Zod, Joi), command execution in exec, and unsafe HTML rendering via dangerouslySetInnerHTML.

Strict checkpoints guide each phase of the review. The agent confirms password hashing with bcrypt or argon2, inspects JWT signing algorithms and expiration, and verifies global headers configured with helmet. For deeper vulnerability analysis, the skill delegates tasks to the typescript-security-expert agent. Findings are compiled into an assessment report scored from 1 to 10 with severity ratings from Low to Critical.

Dependency security checks rely directly on npm audit. If the repository lacks a package-lock.json file or CLI execution permissions are restricted, automated CVE verification cannot complete.

What it helps with

  • detect SQL and NoSQL injection vulnerabilities in database queries
  • audit JWT configurations for missing expiration and weak secrets
  • scan TypeScript source files for hardcoded API keys and tokens
  • inspect React components for unescaped dangerouslySetInnerHTML usage
  • verify security headers and CORS settings across API endpoints

Example prompts for the agent

  • Run a security review on our authentication endpoints
  • Check for security issues in the user profile controller
  • Perform a TypeScript security audit before deploying to production

How to install typescript-security-review

1Skills CLI (Vercel)

npx skills add giuseppe-trisciuoglio/developer-kit --skill typescript-security-review -a claude-code

2Manually: put the files in place

~/.claude/skills/typescript-security-review/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/typescript-security-review/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about typescript-security-review

How do I install typescript-security-review in Claude Code?

Run npx skills add giuseppe-trisciuoglio/developer-kit --skill typescript-security-review -a claude-code. You can also manually save the file to ~/.claude/skills/typescript-security-review/SKILL.md.

What does typescript-security-review check for?

It audits code against OWASP Top 10 vulnerabilities, including injection attacks, XSS, broken authentication, and exposed credentials. It also inspects dependency CVEs via npm audit and checks framework security headers.

Which frameworks and validation libraries does this skill cover?

It includes checks tailored for Express, NestJS, and Next.js applications. For input validation, it looks for schemas built with Zod, Joi, or class-validator, and checks sanitization with tools like DOMPurify.

Source text

SKILL.md · MIT
---
name: typescript-security-review
description: Provides security review capability for TypeScript/Node.js applications, validates code against XSS, injection, CSRF, JWT/OAuth2 flaws, dependency CVEs, and secrets exposure. Use when performing security audits, before deployment, reviewing authentication/authorization implementations, or ensuring OWASP compliance for Express, NestJS, and Next.js. Triggers on "security review", "check for security issues", "TypeScript security audit".
allowed-tools: Read, Edit, Grep, Glob, Bash
---

# TypeScript Security Review

## Overview

Security review for TypeScript/Node.js applications. Evaluates code against OWASP Top 10, framework-specific patterns, and production-readiness criteria. Findings are classified by severity (Critical, High, Medium, Low) with remediation examples. Delegates to the `typescript-security-expert` agent for deep analysis.

## When to Use

- Performing security audits on TypeScript/Node.js codebases
- Reviewing authentication and authorization implementations (JWT, OAuth2, Passport.js)
- Checking for common vulnerabilities (XSS, injection, CSRF, path traversal)
- Validating input validation and sanitization logic
- Reviewing dependency security (npm audit, known CVEs)
- Checking secrets management and environment variable handling
- Assessing API security (rate limiting, CORS, security headers)
- Reviewing Express, NestJS, or Next.js security configurations
- Before deploying to production or after significant code changes
- Compliance checks (GDPR, HIPAA, SOC2 data handling requirements)

## Instructions

1. **Identify Scope**: Determine which files and modules are under review. Prioritize authentication, authorization, data handling, API endpoints, and configuration files. Use `grep` to find security-sensitive patterns (`eval`, `exec`, `innerHTML`, password handling, JWT operations).

   **Checkpoint**: Verify at least 3 security-sensitive files/modules identified before proceeding.

2. **Check Authentication & Authorization**: Review JWT implementation (signing algorithm, expiration, refresh tokens), OAuth2/OIDC integration, session management, password hashing (bcrypt/argon2), and multi-factor authentication. Verify protected routes enforce authentication.

   **Checkpoint**: Use `grep` to confirm all route handlers have auth guards or middleware applied.

3. **Scan for Injection Vulnerabilities**: Check for SQL/NoSQL injection in database queries, command injection in `exec`/`spawn`, template injection, and LDAP injection. Verify parameterized queries and input validation.

   **Checkpoint**: Use `grep` to confirm all database queries use parameterization — no string concatenation with user input.

4. **Review Input Validation**: Check API inputs validated with Zod, Joi, or class-validator. Verify schema completeness — proper type constraints, length limits, format validation. Check for validation bypass paths.

   **Checkpoint**: Verify all public API endpoints have corresponding validation schemas.

5. **Assess XSS Prevention**: Review React components for `dangerouslySetInnerHTML` usage, check Content Security Policy headers, verify HTML sanitization for user-generated content. See `references/xss-prevention.md` for detailed patterns.

   **Checkpoint**: Use `grep` to confirm any `dangerouslySetInnerHTML` usage has sanitization via DOMPurify or equivalent.

6. **Check Secrets Management**: Scan for hardcoded credentials, API keys, secrets in source code. Verify `.env` files are gitignored, secrets accessed through proper management services.

   **Checkpoint**: Run `grep -r "password\|secret\|api.*key\|token" --include="*.ts"` to identify potential secrets in code.

7. **Review Dependency Security**: Run `npm audit` or check `package-lock.json` for known vulnerabilities. Identify outdated dependencies with CVEs. Check for unnecessary dependencies.

   **Checkpoint**: Verify `npm audit` results are reviewed and critical vulnerabilities addressed.

8. **Evaluate Security Headers & Configuration**: Check helmet.js or manual security header configuration. Review CORS policy, rate limiting, HTTPS enforcement, cookie security flags (HttpOnly, Secure, SameSite), and CSP. See `references/security-headers.md` for configuration examples.

   **Checkpoint**: Use `grep` to confirm helmet or equivalent security headers are applied globally.

9. **Produce Security Report**: Generate structured report with severity-classified findings, remediation guidance with code examples, and security posture summary.

   **Feedback Loop**: If Critical or High vulnerabilities found, re-scan related modules for similar patterns before finalizing. Use `grep` to identify if the same vulnerability pattern exists elsewhere.

## Examples

### JWT Security Review

```typescript
// ❌ Critical: Weak JWT configuration
import jwt from 'jsonwebtoken';

const SECRET = 'mysecret123'; // Hardcoded weak secret

function generateToken(user: User) {
  return jwt.sign({ id: user.id, role: user.role }, SECRET);
  // Missing expiration, weak secret, no algorithm specification
}

// ✅ Secure: Proper JWT configuration
import jwt from 'jsonwebtoken';

const JWT_SECRET = process.env.JWT_SECRET;
if (!JWT_SECRET || JWT_SECRET.length < 32) {
  throw new Error('JWT_SECRET must be set and at least 32 characters');
}

function generateToken(user: User): string {
  return jwt.sign(
    { sub: user.id }, // Minimal claims, no sensitive data
    JWT_SECRET,
    {
      algorithm: 'HS256',
      expiresIn: '15m',
      issuer: 'my-app',
      audience: 'my-app-client',
    }
  );
}

function verifyToken(token: string): JwtPayload {
  return jwt.verify(token, JWT_SECRET, {
    algorithms: ['HS256'], // Restrict accepted algorithms
    issuer: 'my-app',
    audience: 'my-app-client',
  }) as JwtPayload;
}
```

### SQL Injection Prevention

```typescript
// ❌ Critical: SQL injection vulnerability
async function findUser(email: string) {
  const result = await db.query(
    `SELECT * FROM users WHERE email = '${email}'`
  );
  return result.rows[0];
}

// ✅ Secure: Parameterized query
async function findUser(email: string) {
  const result = await db.query(
    'SELECT id, name, email FROM users WHERE email = $1',
    [email]
  );
  return result.rows[0];
}

// ✅ Secure: ORM with type-safe queries (Drizzle example)
async function findUser(email: string) {
  return db.select({
    id: users.id,
    name: users.name,
    email: users.email,
  })
  .from(users)
  .where(eq(users.email, email))
  .limit(1);
}
```

See `references/xss-prevention.md` for XSS patterns and `references/security-headers.md` for security headers configuration.

## Review Output Format

Structure all security review findings as follows:

### 1. Security Posture Summary
Overall security assessment score (1-10) with key observations and risk level.

### 2. Critical Vulnerabilities (Immediate Action)
Issues that can be exploited to compromise the system, steal data, or cause unauthorized access.

### 3. High Priority (Address Within 30 Days)
Security misconfigurations, missing protections, or vulnerabilities requiring near-term remediation.

### 4. Medium Priority (Address Within 90 Days)
Issues that reduce security posture but have mitigating factors or limited exploitability.

### 5. Low Priority (Next Cycle)
Security improvements, hardening recommendations, and defense-in-depth enhancements.

### 6. Positive Security Observations
Well-implemented security patterns and practices to acknowledge.

### 7. Remediation Roadmap
Prioritized action items with code examples for the most critical fixes.

## Best Practices

- Validate all inputs at the API boundary — never trust client-side validation alone
- Use parameterized queries or ORMs — never concatenate user input into queries
- Store secrets in environment variables or secret managers — never in source code
- Apply the principle of least privilege for database accounts, API keys, and IAM roles
- Enable security headers (helmet.js) and restrict CORS to known origins
- Implement rate limiting on all public-facing endpoints
- Hash passwords with bcrypt or argon2 — never use MD5/SHA for passwords
- Set cookie flags: `HttpOnly`, `Secure`, `SameSite=Strict`
- Use `npm audit` in CI pipelines to catch dependency vulnerabilities
- Log security events (failed logins, permission denials) without logging sensitive data

## Constraints and Warnings

- Security review is not a substitute for professional penetration testing
- Focus on code-level vulnerabilities — infrastructure security is out of scope
- Respect the project's framework — provide framework-specific remediation guidance
- Do not log, print, or expose discovered secrets — report their location only
- Dependency vulnerabilities should be assessed for actual exploitability, not just presence
- Security recommendations must be practical — consider implementation effort vs risk reduction

## References

See the `references/` directory for detailed security documentation:
- `references/owasp-typescript.md` — OWASP Top 10 mapped to TypeScript/Node.js patterns
- `references/common-vulnerabilities.md` — Common vulnerability patterns and remediation
- `references/dependency-security.md` — Dependency scanning and supply chain security
- `references/xss-prevention.md` — XSS prevention patterns for React and server-side
- `references/security-headers.md` — Security headers and CORS configuration examples
- `references/input-validation.md` — Input validation patterns with Zod and class-validator

© giuseppe-trisciuoglio · MIT · giuseppe-trisciuoglio/developer-kit

Similar skills

Everything for Security →

From the same set93

clean-architecture Guides Clean Architecture, hexagonal architecture and DDD patterns in Java 21+ Spring Boot 3.5+ projects. Use it when separating domain code from frameworks or refactoring coupled code. CX Codex +1 4,000installs spring-boot-openapi-documentation A skill that walks your agent through SpringDoc OpenAPI 3.0 and Swagger UI setup in Spring Boot 3.x projects, annotations included. CX Codex +1 4,000installs nextjs-app-router Patterns and code examples for Next.js 16+ App Router work, including components, actions, API handlers, caching and routing. CX Codex +1 3,900installs spring-boot-crud-patterns A skill that builds the whole CRUD layer for Spring Boot 3 services: aggregates, JPA repositories, DTOs and REST controllers in a feature-based layout. CX Codex +1 3,900installs prompt-engineering This skill helps write, debug, and test LLM prompts. Use it for few-shot examples, system prompts, reasoning workflows, and reusable templates. CX Codex +1 3,900installs spring-boot-saga-pattern A skill for distributed transactions in Spring Boot microservices: choreography and orchestration, compensating actions, Kafka, RabbitMQ, Axon. CX Codex +1 3,800installs unit-test-json-serialization A skill with patterns for unit testing JSON serialization and deserialization using Jackson and @JsonTest in Spring Boot. CX Codex +1 3,800installs unit-test-controller-layer Generates isolated MockMvc unit tests for Spring REST controllers with Mockito. Helps verify HTTP status codes, payload validation, and JsonPath assertions. CX Codex +1 3,800installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor