security-and-hardening

Hardens web application code against OWASP vulnerabilities through validation, authentication, and secrets management patterns.

5|Updated Mar 5, 2024
One-click install
npx skills add https://github.com/TRAPZZY/God-Eyes --skill security-and-hardening-trapzzy
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: security-and-hardening
Source: https://github.com/TRAPZZY/God-Eyes/tree/main/.skills/security-and-hardening
Command: npx skills add https://github.com/TRAPZZY/God-Eyes --skill security-and-hardening-trapzzy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Web applications that accept user input, manage sessions, or integrate external services are exposed to injection, XSS, broken access control, and secret leakage. This Skill provides concrete security patterns and checklists so every feature touching untrusted data is built with defenses in place from the start. ## Core Features & Use Cases - OWASP Top 10 Prevention: Ready-to-use TypeScript patterns for parameterized queries, bcrypt password hashing, session cookie configuration, output encoding, and authorization checks. - Input Validation & Upload Safety: Zod schema validation at API boundaries plus file type and size restrictions for upload handlers. - Security Review Workflow: A three-tier boundary system (always do, ask first, never do), an npm audit triage decision tree, rate limiting setup, secrets management rules, and a pre-release security checklist. - Use Case: When adding a new API endpoint that accepts user data, apply the Skill to validate input with a schema, enforce ownership-based authorization, set security headers via helmet, and verify no secrets leak into responses or logs. ## Quick Start Review my new Express API endpoint for security issues and apply the hardening patterns from the security skill.

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 validate user input in Express API routes?▼

Validate input at the route boundary using a Zod schema with safeParse, returning a 422 error with details when validation fails. This ensures only typed, sanitized data reaches your service layer.

What session cookie settings should I use for authentication?▼

Set session cookies with httpOnly, secure, and sameSite attributes, store the secret in an environment variable, and disable resave and saveUninitialized. Hash passwords with bcrypt using at least 12 salt rounds.

How do I triage npm audit vulnerabilities?▼

Triage by severity and reachability: fix critical or high vulnerabilities immediately if the code path is reachable, schedule moderate issues for the next release, and track low-severity items. Document deferred fixes with a reason and review date.

Why should auth tokens not be stored in localStorage?▼

localStorage is accessible to any JavaScript running on the page, so an XSS vulnerability can steal tokens stored there. Use httpOnly cookies for sessions so tokens are never exposed to client-side scripts.