security-and-hardening

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

Updated Sep 15, 2026
One-click install
npx skills add https://github.com/Qiuyi-Hong/addyosmani-skills --skill security-and-hardening-qiuyi-hong
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-and-hardening
Source: https://github.com/Qiuyi-Hong/addyosmani-skills/tree/main/skills/security-and-hardening
Command: npx skills add https://github.com/Qiuyi-Hong/addyosmani-skills --skill security-and-hardening-qiuyi-hong

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, SSRF, broken access control, and supply-chain attacks. This Skill gives an AI agent a structured security workflow — threat modeling, boundary validation, dependency triage, and privacy compliance — so vulnerabilities are prevented at design time instead of patched after a breach. ## Core Features & Use Cases - Threat Modeling with STRIDE: Maps trust boundaries, names assets, and runs a STRIDE pass over each boundary before writing controls, addressing OWASP A04 Insecure Design. - OWASP Top 10 Prevention Patterns: Provides concrete TypeScript code for parameterized queries, bcrypt password hashing, secure session cookies, CSP headers, output encoding, SSRF allowlisting, and schema validation with zod. - Dependency & Supply-Chain Triage: Decision tree for package-manager audit findings by severity and reachability, plus lockfile integrity, install-script blocking, and typosquat detection. - AI/LLM Security & Privacy Compliance: Covers the OWASP LLM Top 10 (prompt injection, untrusted model output, excessive agency) and GDPR/CCPA data classification, retention, and deletion paths. - Use Case: When adding a webhook endpoint that fetches user-supplied URLs, the agent applies the SSRF allowlist pattern — validating scheme, host, and resolved IPs — instead of fetching arbitrary URLs. ## Quick Start Ask the agent to audit your login flow or input handler against the OWASP Top Ten and apply the hardening patterns from this 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 a Node.js API?

Prevent SQL injection by using parameterized queries instead of string concatenation, such as db.query('SELECT * FROM users WHERE id = $1', [userId]), or an ORM like Prisma with typed inputs. Validate all external input at the route boundary with a schema validator like zod.

How do I protect a server from SSRF when fetching user-supplied URLs?

Protect against SSRF by allowlisting the URL scheme and hostname, resolving all DNS records and rejecting any private or reserved IP range, and disabling redirects. For high-risk surfaces, pin the resolved IP or use a filtering agent, since DNS rebinding creates a TOCTOU gap.

How should I triage npm audit vulnerabilities?

Triage audit findings by severity and reachability: fix reachable critical and high issues immediately, schedule moderate production issues for the next release, and track low-severity items. Never run npm audit fix --force blindly; preview changes, read changelogs, and test each upgrade.

Does express-rate-limit work behind a load balancer?

No, express-rate-limit keeps counters in process memory by default, so each instance counts separately and the effective limit multiplies by instance count. Use a shared store such as Redis via rate-limit-redis, or an HTTP-based limiter like @upstash/ratelimit for serverless runtimes.

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 it defensively with JSON.parse and a schema validator, then encode it before rendering, and keep secrets and other users' data out of the prompt context.

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 enough once it reaches a remote. After rotation, purge it from history and add the file pattern to .gitignore.