Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
aiskillstore avatar

Security Patterns

  • 1 installs
  • 404 repo stars
  • Updated August 5, 2026
  • aiskillstore/marketplace

security-patterns is a language-agnostic skill of OWASP-aligned secure-coding patterns for web applications.

About

security-patterns is a skill covering essential security patterns and OWASP guidelines for web applications. It includes an OWASP Top 10 quick reference, input validation and output-encoding rules, authentication and authorization examples, secrets-management rules, security headers, and quick audit grep commands. A developer uses it during security review or secure coding.

  • OWASP Top 10 quick reference with prevention
  • Language-agnostic input validation and output encoding
  • Auth, authorization, and secrets-management checklists

Security Patterns by the numbers

  • 1 all-time installs (skills.sh)
  • Ranked #1,835 of 2,203 Security skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

security-patterns capabilities & compatibility

Capabilities
security audit · secure coding review · input validation · secrets management
Use cases
security audit · code review
Pricing
Free
From the docs

What security-patterns says it does

## OWASP Top 10 Quick Reference
SKILL.md
Hash passwords with bcrypt/argon2 (cost factor 12+)
SKILL.md
npx skills add https://github.com/aiskillstore/marketplace --skill security-patterns

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1
repo stars404
Last updatedAugust 5, 2026
Repositoryaiskillstore/marketplace

What it does

Apply OWASP-aligned validation, auth, and secrets patterns during security review.

Who is it for?

Security reviews and secure coding across validation, auth, authorization, and secrets

Skip if: Deep framework-specific configuration beyond the referenced examples

When should I use this skill?

Doing a security review or applying OWASP, input-validation, or secrets-management patterns

What you get

Code that follows OWASP-aligned validation, encoding, auth, and secrets patterns.

  • OWASP reference table
  • Auth checklist
  • Security audit grep commands

By the numbers

  • OWASP Top 10 reference table (A01-A10)
  • 6-item auth checklist

Files

SKILL.mdMarkdownGitHub ↗

Security Patterns

Essential security patterns for web applications.

OWASP Top 10 Quick Reference

RankVulnerabilityPrevention
A01Broken Access ControlCheck permissions server-side, deny by default
A02Cryptographic FailuresUse TLS, hash passwords, encrypt sensitive data
A03InjectionParameterized queries, validate input
A04Insecure DesignThreat modeling, secure defaults
A05Security MisconfigurationHarden configs, disable unused features
A06Vulnerable ComponentsUpdate dependencies, audit regularly
A07Auth FailuresMFA, rate limiting, secure session management
A08Data Integrity FailuresVerify signatures, use trusted sources
A09Logging FailuresLog security events, protect logs
A10SSRFValidate URLs, allowlist destinations

Input Validation

# WRONG - Trust user input
def search(query):
    return db.execute(f"SELECT * FROM users WHERE name = '{query}'")

# CORRECT - Parameterized query
def search(query):
    return db.execute("SELECT * FROM users WHERE name = ?", [query])

Validation Rules

Always validate:
- Type (string, int, email format)
- Length (min/max bounds)
- Range (numeric bounds)
- Format (regex for patterns)
- Allowlist (known good values)

Never trust:
- URL parameters
- Form data
- HTTP headers
- Cookies
- File uploads

Output Encoding

// WRONG - Direct HTML insertion
element.innerHTML = userInput;

// CORRECT - Text content (auto-escapes)
element.textContent = userInput;

// CORRECT - Template with escaping
render(`<div>${escapeHtml(userInput)}</div>`);

Encoding by Context

ContextEncoding
HTML bodyHTML entity encode
HTML attributeAttribute encode + quote
JavaScriptJS encode
URL parameterURL encode
CSSCSS encode

Authentication

# Password hashing (use bcrypt, argon2, or scrypt)
import bcrypt

def hash_password(password: str) -> bytes:
    return bcrypt.hashpw(password.encode(), bcrypt.gensalt(rounds=12))

def verify_password(password: str, hashed: bytes) -> bool:
    return bcrypt.checkpw(password.encode(), hashed)

Auth Checklist

  • [ ] Hash passwords with bcrypt/argon2 (cost factor 12+)
  • [ ] Implement rate limiting on login
  • [ ] Use secure session tokens (random, long)
  • [ ] Set secure cookie flags (HttpOnly, Secure, SameSite)
  • [ ] Implement account lockout after failed attempts
  • [ ] Support MFA for sensitive operations

Authorization

# WRONG - Check only authentication
@login_required
def delete_post(post_id):
    post = Post.get(post_id)
    post.delete()

# CORRECT - Check authorization
@login_required
def delete_post(post_id):
    post = Post.get(post_id)
    if post.author_id != current_user.id and not current_user.is_admin:
        raise Forbidden("Not authorized to delete this post")
    post.delete()

Secrets Management

# WRONG - Hardcoded secrets
API_KEY = "sk-1234567890abcdef"

# CORRECT - Environment variables
API_KEY = os.environ["API_KEY"]

# BETTER - Secrets manager
API_KEY = secrets_client.get_secret("api-key")

Secret Handling Rules

DO:
- Use environment variables or secrets manager
- Rotate secrets regularly
- Use different secrets per environment
- Audit secret access

DON'T:
- Commit secrets to git
- Log secrets
- Include secrets in error messages
- Share secrets in plain text

Security Headers

Content-Security-Policy: default-src 'self'; script-src 'self'
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
Strict-Transport-Security: max-age=31536000; includeSubDomains
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy: geolocation=(), camera=()

Quick Security Audit

# Find hardcoded secrets
rg -i "(password|secret|api_key|token)\s*=\s*['\"][^'\"]+['\"]" --type py

# Find SQL injection risks
rg "execute\(f['\"]|format\(" --type py

# Find eval/exec usage
rg "\b(eval|exec)\s*\(" --type py

# Check for TODO security items
rg -i "TODO.*security|FIXME.*security"

Additional Resources

  • ./references/owasp-detailed.md - Full OWASP Top 10 details
  • ./references/auth-patterns.md - JWT, OAuth, session management
  • ./references/crypto-patterns.md - Encryption, hashing, signatures
  • ./references/secure-headers.md - HTTP security headers guide

Scripts

  • ./scripts/security-scan.sh - Quick security grep patterns
  • ./scripts/dependency-audit.sh - Check for vulnerable dependencies

Related skills

FAQ

How should passwords be hashed?

Use bcrypt, argon2, or scrypt with a cost factor of 12 or higher.

What input should never be trusted?

URL parameters, form data, HTTP headers, cookies, and file uploads.

Securityappsecauditsecrets

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.