security-and-hardening

Hardens web application code against OWASP vulnerabilities, injection, XSS, SSRF, and LLM threats.

Updated Aug 11, 2026
One-click install
npx skills add https://github.com/Kunj-Sharma03/agent-contextify --skill security-and-hardening-kunj-sharma03
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-and-hardening
Source: https://github.com/Kunj-Sharma03/agent-contextify/tree/main/templates/skills/security-and-hardening
Command: npx skills add https://github.com/Kunj-Sharma03/agent-contextify --skill security-and-hardening-kunj-sharma03

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, broken access control, SSRF, and supply-chain attacks. This Skill provides a threat-model-first workflow and concrete prevention patterns so security is built into every feature rather than bolted on later. ## Core Features & Use Cases - Threat Modeling with STRIDE: Map trust boundaries, name assets, and run a lightweight STRIDE analysis before writing security controls. - OWASP Prevention Patterns: Ready-to-use TypeScript code for parameterized queries, bcrypt password hashing, secure session cookies, CSP headers, CORS restriction, and Zod schema validation at API boundaries. - 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. - Supply-Chain Hygiene: Dependency audit triage by reachability and severity, lockfile integrity rules, and blocking unreviewed install scripts. - Use Case: When adding a webhook endpoint that fetches user-supplied URLs, apply the SSRF allowlist pattern to block requests to internal IPs and cloud metadata endpoints. ## Quick Start Ask the agent to review your new API endpoint for security issues using the security-and-hardening checklist before committing the code.

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 correctly.

How do I protect a server from SSRF attacks on webhook URLs?

Protect against SSRF by allowlisting schemes and hostnames, resolving all DNS records and rejecting any private or reserved IP ranges, and disabling redirects. Be aware of the TOCTOU DNS-rebinding gap and pin resolved IPs for high-risk surfaces.

What password hashing algorithm should I use for authentication?

Use bcrypt, scrypt, or argon2 for password hashing, never plaintext storage. With bcrypt, use at least 12 salt rounds and compare hashes with the library's timing-safe compare function.

Is LLM output safe to render directly in the DOM?

No, LLM output must be treated as untrusted input per OWASP LLM05. Never pass it to eval, SQL, shell commands, or innerHTML; parse it defensively, validate against a schema, and encode it before rendering.

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

No, never apply forced audit remediation automatically because it may cross declared dependency ranges. Triage findings by severity and code reachability, preview fixes, read changelogs, and test each upgrade individually.

What are the limitations of dependency security audits?

Audits only match known advisories and cannot detect newly malicious or typosquatted packages. Combine audits with lockfile integrity checks, registry signature verification, install-script blocking, and manual review of new dependencies.