security-and-hardening

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

Updated Jun 8, 2026
One-click install
npx skills add https://github.com/Avistian/nba --skill security-and-hardening-avistian
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: security-and-hardening
Source: https://github.com/Avistian/nba/tree/main/.cursor/skills/security-and-hardening
Command: npx skills add https://github.com/Avistian/nba --skill security-and-hardening-avistian

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 review process so vulnerabilities are caught in design and code before they reach production. ## Core Features & Use Cases - Threat Modeling with STRIDE: Map trust boundaries, name assets, and run a lightweight STRIDE analysis before writing controls, addressing OWASP A04 Insecure Design. - OWASP Prevention Patterns: Copy-ready TypeScript patterns for parameterized queries, bcrypt password hashing, secure session cookies, CSP headers, CORS restriction, and output encoding. - SSRF and LLM Security: Allowlist-based URL validation with DNS resolution checks, plus guidance for treating LLM output as untrusted input per the OWASP LLM Top 10. - Use Case: While building an API endpoint that accepts a user-supplied webhook URL, apply the SSRF validation pattern to reject private IPs and the input validation pattern with zod schemas to reject malformed payloads. ## Quick Start Review my new API endpoint for security vulnerabilities and apply the appropriate hardening patterns.

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 validate user input at API boundaries?▼

Validate input at the route handler using a schema library like zod, defining types, length limits, and enums for each field. Return a 422 response with structured error details when safeParse fails, and only pass validated data to services.

How do I prevent SSRF when fetching user-supplied URLs?▼

Prevent SSRF by allowlisting hosts, requiring HTTPS, resolving all DNS records, and rejecting any private or reserved IP ranges including 169.254.169.254. Disable redirects and be aware of DNS-rebinding TOCTOU gaps on high-risk surfaces.

Does npm audit catch all dependency security risks?▼

No, npm audit only catches known CVEs and will not detect malicious or typosquatted packages. Also commit the lockfile, install with npm ci in CI, review new dependencies before adding them, and watch for postinstall scripts.

How should LLM output be handled securely in web apps?▼

Treat all LLM output as untrusted input: never pass it into eval, SQL, shell commands, or innerHTML. Parse it defensively with JSON.parse and schema validation, run only allowlisted actions, and encode it before rendering.

What should I do if a secret is committed to git?▼

Rotate the secret immediately by revoking and reissuing the key, because deleting the line or rewriting history is not sufficient. Assume any secret that reaches a remote repository is compromised, then purge it from history.