security-patterns
Skill8 starsChanged 19 days agoMITView on GitHub
Auth, input-validation, and secrets conventions. Use when writing or reviewing authentication, authorization, middleware, routes, JWT, CSRF, or CORS code; for a full audit of pending changes use /security-review.
- Reads credentials
9 other projects use a version of this.
Adopted by
Most recently taken up by
- capture0x/YeepForgetheir own version, first seen Nov 8, 2026
- ku5ic/claude-kittheir own version, first seen Nov 4, 2026
- CrowdStrike/foundry-skillstheir own version, first seen Oct 30, 2026
- mikulgohil/claude-skillstheir own version, first seen Oct 13, 2026
- Eyadkelleh/awesome-claude-skills-securitytheir own version, first seen Oct 8, 2026
- CloudAI-X/claude-workflowtheir own version, first seen Oct 8, 2026
Used with
Projects with it also use security-fuzzing and security-payloads.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
EyadkellehSkillsecurity-fuzzing
Essential fuzzing payloads: SQL injection, command injection, special characters. Curated essentials for vulnerability testing.
Also in 3 projects that use this
EyadkellehSkillsecurity-payloads
Essential exploitation payloads: anti-virus test files, file name exploits, malicious files. Curated for testing.
Also in 3 projects that use this
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- CloudAI-X/claude-workflow★ 1.4ksame name
- CloudAI-X/claude-workflow-v2★ 1.4ksame name
- Eyadkelleh/awesome-claude-skills-security★ 388same name
- Eyadkelleh/awesome-skills-security★ 384same name
- CrowdStrike/foundry-skills★ 37same name
- capture0x/YeepForge★ 8same name
- ku5ic/claude-kit★ 2same name
- mikulgohil/claude-skills★ 0same name
- terrene-foundation/pact★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- home/CLAUDE.mdCLAUDE.md
- run-claude-code-configSkill
- adrSkill
- api-designSkill
- commitSkill
- django-patternsSkill
- docker-patternsSkill
- eow-reviewSkill
- git-workflowSkill
- hotfixSkill
- infrastructureSkill
- laterSkill
- mkdocs-styleSkill
- project-setupSkill
- prSkill
- refinementSkill
- standupSkill
- statusSkill
- testing-patternsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 10 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use allowlists over denylists for input filtering
- Distinctive: line 20
Always: use parameterized queries or ORM methods
- Distinctive: line 39
Use constant-time comparison for tokens and secrets
- Distinctive: line 46
Never store sensitive data in JWT payload (it's base64, not encrypted)
- Very specific: line 48
Use RS256 or ES256 over HS256 for multi-service architectures
- Very specific: line 53
Use SameSite=Lax or Strict on session cookies
- Distinctive: line 55
Never disable CSRF protection for convenience
- Distinctive: line 59
Check permissions on every request, not just in UI
- Distinctive: line 60
Use role-based or attribute-based access control
- Very specific: line 61
Verify object ownership: if obj.owner != request.user: return 403
- Distinctive: line 66
Never hardcode secrets, API keys, or passwords in code
- Distinctive: line 67
Use environment variables or secret managers (AWS Secrets Manager, Vault)
- Very specific: line 68
Add .env and credential files to .gitignore
- Distinctive: line 73
Ensure these headers are set in production:
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Security Patterns
Apply these security practices when writing or reviewing code in auth, middleware, and API layers.
Input Validation
- Always validate at system boundaries (API endpoints, form handlers, message consumers)
- Never trust client-side validation alone
- Use allowlists over denylists for input filtering
- Validate types, lengths, ranges, and formats
- Sanitize HTML output to prevent XSS (use framework auto-escaping)
SQL Injection Prevention
- Always use parameterized queries or ORM methods
- Never construct SQL with string concatenation or f-strings
- Django: use QuerySet methods,
Qobjects, orparamsargument for raw SQL - Node.js: use query builders (Knex) or ORM (Prisma, TypeORM) -- never template literals in SQL
# WRONG
User.objects.raw(f"SELECT * FROM users WHERE email = '{email}'")
# CORRECT
User.objects.raw("SELECT * FROM users WHERE email = %s", [email])
User.objects.filter(email=email)Authentication
- Hash passwords with bcrypt, argon2, or scrypt (never MD5/SHA alone)
- Enforce minimum password complexity at registration
- Rate-limit login attempts (exponential backoff or account lockout)
- Use constant-time comparison for tokens and secrets
- Invalidate sessions on password change
JWT / Token Security
- Set short expiration times (15min for access tokens, days for refresh)
- Store refresh tokens server-side (database or Redis)
- Never store sensitive data in JWT payload (it's base64, not encrypted)
- Validate
iss,aud, andexpclaims on every request - Use
RS256orES256overHS256for multi-service architectures
CSRF Protection
- Enable framework CSRF middleware (Django:
CsrfViewMiddleware) - Use
SameSite=LaxorStricton session cookies - For SPAs: use token-based auth or double-submit cookies
- Never disable CSRF protection for convenience
Authorization
- Check permissions on every request, not just in UI
- Use role-based or attribute-based access control
- Verify object ownership:
if obj.owner != request.user: return 403 - Log authorization failures for monitoring
Secrets Management
- Never hardcode secrets, API keys, or passwords in code
- Use environment variables or secret managers (AWS Secrets Manager, Vault)
- Add
.envand credential files to.gitignore - Rotate secrets on schedule and after any suspected breach
HTTP Security Headers
Ensure these headers are set in production:
Strict-Transport-Security: max-age=31536000; includeSubDomainsContent-Security-Policy: default-src 'self'X-Content-Type-Options: nosniffX-Frame-Options: DENYReferrer-Policy: strict-origin-when-cross-origin
Logging
- Log authentication events (login, logout, failed attempts)
- Log authorization failures
- Never log passwords, tokens, API keys, or PII
- Include request IDs for traceability
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

