backend-security-coder

Backend Security Coder

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "backend-security-coder" with this command: npx skills add mileycy516-stack/skills/mileycy516-stack-skills-backend-security-coder

Backend Security Coder

Expert backend security developer specializing in secure coding practices, vulnerability prevention, and defensive programming.

When to Use This Skill

  • Implementing Authentication (JWT, Role-Based Access)

  • Validating Input (Sanitization, Zod/Joi)

  • Securing APIs (Rate Limiting, CORS, Headers)

  • Preventing Injection (SQL, NoSQL, Shell)

  • Reviewing Code for Vulnerabilities (OWASP Top 10)

Workflow

  • Validate: Trust no one. Validate inputs at the edge using schemas (Zod).

  • Authenticate: Verify identity securely (HTTP-only cookies, Bearer tokens).

  • Authorize: Verify permission (RBAC/ABAC).

  • Protect: Apply defense-in-depth (Rate Limits, Helium Headers, Prepared Statements).

  • Sanitize: Encode outputs to prevent XSS.

Instructions

  1. Input Validation (Defense Line 1)

Never assume input is safe.

  • Whitelisting: Only accept known good characters/formats.

  • Schema: Use Zod/Joi. const UserSchema = z.object({ email: z.string().email(), age: z.number().int().min(18) });

  1. Authentication & Authorization
  • Passwords: NEVER store plain text. Use bcrypt or argon2 .

  • JWT:

  • Sign with strong secrets.

  • Use short expiration (15m).

  • Use Refresh Tokens for long sessions.

  • RBAC: Middleware must check roles. app.post('/admin', requireRole('admin'), handler) .

  1. Injection Prevention
  • SQL Injection: Always use Prepared Statements / Parameterized Queries.

  • ❌ db.query("SELECT * FROM users WHERE name = '" + name + "'")

  • ✅ db.query("SELECT * FROM users WHERE name = $1", [name])

  • NoSQL Injection: Validate that input is a primitive string, not an object {$gt: ""} .

  1. API Security Headers
  • HSTS: Enforce HTTPS.

  • CSP: Content Security Policy.

  • X-Content-Type-Options: nosniff .

Resources

  • Secure Authentication Patterns

  • Input Validation Guide

  • OWASP Prevention Cheat Sheet

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

trading-psychology-coach

No summary provided by upstream source.

Repository SourceNeeds Review
General

vercel-react-best-practices

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

frontend-developer

No summary provided by upstream source.

Repository SourceNeeds Review
General

api-tester

No summary provided by upstream source.

Repository SourceNeeds Review