security-patterns

Implement OWASP Top 10 defenses including input validation, authentication, and encryption in web applications.

3|Updated Aug 26, 2026
One-click install
npx skills add https://github.com/Fabric-Pro/fabric-oss --skill security-patterns-fabric-pro
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: security-patterns
Source: https://github.com/Fabric-Pro/fabric-oss/tree/main/.cursor/skills/security-patterns
Command: npx skills add https://github.com/Fabric-Pro/fabric-oss --skill security-patterns-fabric-pro

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Web applications face constant threats from injection attacks, XSS, CSRF, broken authentication, and data exposure, and developers often lack a consolidated reference for implementing defenses correctly. ## Core Features & Use Cases - OWASP Top 10 Coverage: Provides code patterns for preventing SQL injection, XSS, CSRF, broken access control, and sensitive data exposure. - Authentication & Session Patterns: Includes bcrypt password hashing, JWT token handling, secure session cookies, and RBAC middleware examples. - Operational Security: Covers rate limiting, security headers with helmet, secrets management, and security event logging. - Use Case: When building a login endpoint, apply the rate limiting, bcrypt hashing, JWT generation, and failed-attempt logging patterns to ship a hardened authentication flow. ## Quick Start Ask the AI to review your Express API endpoint for security vulnerabilities and apply the appropriate protection patterns from this skill.

Frequently Asked Questions about security-patterns

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, passing user input as bound parameters to the database driver. Alternatively, use an ORM with input validation, such as parsing and type-checking IDs before querying.

How to implement secure password hashing with bcrypt?▼

Hash passwords with bcrypt using a salt rounds factor of 10 before storing them, never saving plaintext passwords. Verify credentials at login with bcrypt.compare against the stored hash.

What security headers should an Express app use?▼

Use the helmet middleware to set headers automatically, or manually configure X-Frame-Options, X-Content-Type-Options, Strict-Transport-Security, Content-Security-Policy, Referrer-Policy, and Permissions-Policy. These mitigate clickjacking, MIME sniffing, and XSS risks.

Does JWT authentication need CSRF protection?▼

JWTs sent in Authorization headers are not vulnerable to CSRF, but tokens stored in cookies are. For cookie-based sessions, use SameSite=strict cookies, CSRF tokens via csurf, and origin header validation.

Why is rate limiting important for login endpoints?▼

Rate limiting blocks brute-force credential attacks by capping requests per IP, such as 5 login attempts per 15 minutes. Use express-rate-limit with a Redis store for distributed deployments and skip counting successful requests.