security-and-hardening

Hardens web application code against OWASP vulnerabilities through threat modeling and defensive patterns.

Updated Jul 1, 2026
One-click install
npx skills add https://github.com/raishoemi/traffic-sim-v2 --skill security-and-hardening-raishoemi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-and-hardening
Source: https://github.com/raishoemi/traffic-sim-v2/tree/main/.github/skills/security-and-hardening
Command: npx skills add https://github.com/raishoemi/traffic-sim-v2 --skill security-and-hardening-raishoemi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Web applications that accept user input, manage sessions, or integrate external services are exposed to injection, XSS, SSRF, broken access control, and supply-chain attacks. This Skill provides a structured security workflow so vulnerabilities are prevented at design time rather than patched after a breach. ## Core Features & Use Cases - Threat Modeling First: Maps trust boundaries and runs a lightweight STRIDE analysis before writing controls, addressing OWASP A04 Insecure Design. - OWASP Prevention Patterns: Provides concrete TypeScript code patterns for parameterized queries, bcrypt password hashing, session cookie flags, CSP headers, CORS restriction, and Zod-based input validation. - SSRF and LLM Security: Covers allowlist-based URL validation with DNS resolution checks, plus OWASP LLM Top 10 guidance for treating model output as untrusted input. - Use Case: When adding a webhook endpoint that fetches user-supplied URLs, apply the SSRF pattern to validate scheme, host allowlist, and resolved IP ranges before any outbound request. ## Quick Start Review my new API endpoint for security vulnerabilities and apply the appropriate hardening patterns before I commit it.

Frequently Asked Questions about security-and-hardening

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

FAQPage Schema
How do I prevent SQL injection in Node.js applications?

Prevent SQL injection by using parameterized queries instead of string concatenation, such as db.query('SELECT * FROM users WHERE id = $1', [userId]). ORMs like Prisma also parameterize inputs automatically when used with their query APIs.

How do I protect against SSRF when fetching user-supplied URLs?

Protect against SSRF by enforcing an https-only scheme, an explicit host allowlist, and DNS resolution checks that reject any private or reserved IP range. Disable redirects and be aware of DNS-rebinding TOCTOU gaps on high-risk surfaces.

What session cookie settings should I use for authentication?

Session cookies should be httpOnly so JavaScript cannot read them, secure so they only travel over HTTPS, and sameSite set to lax or strict for CSRF protection. Hash passwords with bcrypt at 12 or more salt rounds and never store tokens in localStorage.

How should I treat LLM output in my application?

Treat all LLM output as untrusted input per OWASP LLM05. Never pass model output into eval, SQL, shell commands, or innerHTML; instead parse it defensively, validate it against a schema, and encode it before rendering.

When should I fix npm audit vulnerabilities?

Fix critical and high severity vulnerabilities immediately if the vulnerable code is reachable in production. Moderate issues can wait for the next release cycle, and low severity items can be handled during regular dependency updates with a documented review date.

What should I do if a secret was committed to git?

Rotate the secret immediately by revoking and reissuing the key, because deleting the line or rewriting history is not sufficient once it reaches a remote. After rotation, purge it from history and add env files to .gitignore.