security-and-hardening

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

Updated May 13, 2026
One-click install
npx skills add https://github.com/sapatamuku-creator/mastersapatamuku --skill security-and-hardening-sapatamuku-creator
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: security-and-hardening
Source: https://github.com/sapatamuku-creator/mastersapatamuku/tree/main/releases/v2.7/.agents/skills/security-and-hardening
Command: npx skills add https://github.com/sapatamuku-creator/mastersapatamuku --skill security-and-hardening-sapatamuku-creator

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 instead of patched after a breach. ## Core Features & Use Cases - Threat Modeling with STRIDE: Map trust boundaries, name assets, and run STRIDE over each boundary before writing code, 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, Zod input validation, and SSRF-safe URL fetching. - Supply-Chain and LLM Security: Triage dependency audit results by reachability, block unreviewed install scripts, and treat LLM output as untrusted input per the OWASP LLM Top 10. - Use Case: When adding a webhook endpoint that fetches user-supplied URLs, apply the SSRF allowlist pattern with DNS resolution checks to block requests to internal services like cloud metadata endpoints. ## Quick Start Ask the AI to review your new API endpoint for security issues using the security-and-hardening checklist before merging.

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 a server from SSRF when fetching user-supplied URLs?▼

Protect against SSRF by allowlisting schemes and hosts, resolving all DNS records and rejecting any private or reserved IP ranges, and disabling redirects. Note the remaining TOCTOU gap where DNS can rebind between validation and connection, so high-risk surfaces should pin the resolved IP.

What session cookie settings prevent session hijacking?▼

Set session cookies with httpOnly to block JavaScript access, secure to require HTTPS, and sameSite to mitigate CSRF. Store the session secret in an environment variable, never in source code, and apply stricter rate limiting on authentication endpoints.

Should I run npm audit fix --force to resolve vulnerabilities?▼

Never apply forced audit remediation automatically, since forced fixes may cross declared dependency ranges and break your application. Instead triage findings by severity and code reachability, preview the remediation, read changelogs, and test each upgrade individually.

How do I secure LLM output in my application?▼

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

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 enough once it reaches a remote. Assume the credential is compromised the moment it is pushed, then purge it from history.