security-and-hardening

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

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/MSC72m/DevForge --skill security-and-hardening-msc72m
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: security-and-hardening
Source: https://github.com/MSC72m/DevForge/tree/main/skills/security-and-hardening
Command: npx skills add https://github.com/MSC72m/DevForge --skill security-and-hardening-msc72m

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Applications that accept user input, manage sessions, or integrate external services ship with exploitable vulnerabilities when security is treated as an afterthought. This Skill enforces security-first development by providing threat modeling, hardening controls, and concrete code patterns for every feature that touches untrusted data. ## Core Features & Use Cases - Threat Modeling with STRIDE: Map trust boundaries, name assets, and run STRIDE analysis before writing code, covering spoofing, tampering, repudiation, information disclosure, denial of service, and elevation of privilege. - OWASP Hardening Patterns: Concrete TypeScript implementations for injection prevention, bcrypt/argon2 password hashing, XSS output encoding, authorization checks, security headers, CORS restriction, SSRF defenses, and rate limiting with shared stores. - Supply Chain and Dependency Auditing: Triage package-manager audit findings by reachability, block unreviewed dependency install scripts, and verify lockfile integrity before releases. - Privacy and LLM Security: Classify personal data for GDPR/CCPA compliance, design deletion and export paths, and treat LLM output as untrusted input mapped to the OWASP LLM Top 10. - Use Case: When building a login flow, use this Skill to verify passwords are hashed with bcrypt, session cookies are httpOnly/secure/sameSite, auth endpoints are rate-limited, and the flow resists the OWASP Top Ten. ## Quick Start Audit my authentication endpoint and input handlers for OWASP Top Ten vulnerabilities and apply the 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 using their query methods.

How to secure session cookies against XSS and CSRF attacks?▼

Set session cookies with httpOnly to block JavaScript access, secure to require HTTPS, and sameSite 'lax' or 'strict' for CSRF defense. Hash passwords with bcrypt at 12 or more rounds, scrypt, or argon2, and load the session secret from the environment.

What is SSRF and how do I prevent it in webhooks?▼

SSRF occurs when a server fetches a user-influenced URL that targets internal services like cloud metadata endpoints. Prevent it by allowlisting scheme and host, resolving all DNS records and rejecting private or reserved IPs, and forbidding redirects.

Does npm audit catch malicious or typosquatted packages?▼

No, package-manager audits only match known advisories and do not detect newly malicious or typosquatted packages. Review new dependencies, lockfile diffs, and install scripts together, and verify registry signatures where supported.

Why is in-memory rate limiting unsafe with multiple server instances?▼

In-memory rate limiters keep counters per process, so behind a load balancer the effective limit becomes max times instances, and on serverless a fresh invocation starts from zero. Back the limiter with a shared store like Redis or an HTTP-based limiter such as @upstash/ratelimit.

How should LLM output be handled to avoid security vulnerabilities?▼

Treat LLM output as untrusted input: never pass it into eval, SQL, shells, innerHTML, or file paths. Parse defensively, validate against a schema, then encode before rendering, and keep secrets and other tenants' data out of the context window.