security-audit
Skill8 starsChanged 9 days agoMITView on GitHub
Audits code for security issues and writes secure code, checking against the OWASP Top 10 risk categories with concrete, language-specific checks - broken access control and IDOR, injection, XSS, SSRF, authentication, sessions and JWTs, secrets, cryptography, unsafe deserialization, file uploads, CSRF, security headers, vulnerable dependencies and security logging. Use when asked for a security audit or security review of code, when writing code that handles user input, auth, files, URLs, secrets or money, when reviewing a PR for security, hardening an endpoint, or triaging scanner findings.
- Reads credentials
- Installs packages
192 other projects use a version of this.
Adopted by
Most recently taken up by
- argos-ci/argostheir own version, first seen Nov 9, 2026
- classroomio/classroomiotheir own version, first seen Nov 9, 2026
- dio-az/dotfilestheir own version, first seen Nov 8, 2026
- roke22/Squadratheir own version, first seen Nov 8, 2026
- qwwiwi/agentos-skills-publictheir own version, first seen Nov 8, 2026
- craigcossairt/trellistheir own version, first seen Nov 8, 2026
Used with
Projects with it also use create-stories, story-done and 10 more.
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.
lilangMaxSkillcreate-stories
Break a single epic into implementable story files. Reads the epic, its GDD, governing ADRs, and control manifest. Each story embeds its GDD requirement TR-ID, ADR guidance, acceptance criteria, story type, and test evidence path. Run after /create-epics for each epic.
Also in 11 projects that use this
lilangMaxSkillstory-done
End-of-story completion review. Reads the story file, verifies each acceptance criterion against the implementation, checks for GDD/ADR deviations, prompts code review, updates story status to Complete, and surfaces the next ready story from the sprint.
Also in 11 projects that use this
nicepkgSkillcommunity-led-growth
Expert in community-led growth (CLG) - leveraging user communities to drive acquisition, retention, and expansion. Covers building developer communities, user groups, ambassador programs, and turning customers into advocates. Knows the difference between community as a feature vs community as a growth engine, and how to measure community ROI. Use when "community-led, CLG, ambassador program, champion program, user community, developer community, word of mouth, user group, " mentioned.
Also in 5 projects that use this
nicepkgSkillph-community-outreach
Engage Reddit, Indie Hackers, Hacker News and other communities for Product Hunt launches. Use this skill to identify relevant communities, craft appropriate posts, and drive cross-platform engagement without appearing spammy.
Also in 5 projects that use this
- +7 more from lilangMax
- +1 more from nicepkg
Other versions192 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 192
- ruvnet/claude-flow★ 80ksame name
- ruvnet/ruflo★ 79ksame name
- PostHog/posthog★ 40ksame name
- Donchitos/Claude-Code-Game-Studios★ 27ksame name
- cloudflare/security-audit-skill★ 18ksame name
- rommapp/romm★ 14ksame name
- kubeshark/kubeshark★ 12ksame name
- maximhq/bifrost★ 9.4ksame name
- mono/SkiaSharp★ 5.6ksame name
- MaxMiksa/Auto-Company★ 3.2ksame name
182 more not listed
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 repository60 other files it gives its agents.
- api-designSkill
- auth-implementationSkill
- background-jobsSkill
- building-agentsSkill
- caching-strategiesSkill
- ci-cd-pipelinesSkill
- cloud-cost-optimizationSkill
- codebase-onboardingSkill
- code-review-changesSkill
- concurrency-patternsSkill
- database-migrationsSkill
- database-schema-designSkill
- database-testingSkill
- data-pipelinesSkill
- data-privacy-retentionSkill
- dependency-upgradesSkill
- design-docsSkill
- design-systemsSkill
- dockerfilesSkill
- domain-driven-designSkill
- event-driven-architectureSkill
- file-storage-uploadsSkill
- frontend-securitySkill
- git-workflowSkill
- graphql-apisSkill
- grpc-servicesSkill
- incident-responseSkill
- infrastructure-as-codeSkill
- internationalizationSkill
- kubernetes-deploymentsSkill
- large-scale-migrationsSkill
- legacy-refactoringSkill
- llm-evalsSkill
- llm-integrationSkill
- mcp-serversSkill
- micro-frontendsSkill
- ml-experimentsSkill
- monorepo-managementSkill
- nosql-designSkill
- observabilitySkill
- orm-patternsSkill
- performance-profilingSkill
- postgres-operationsSkill
- rag-systemsSkill
- react-patternsSkill
- realtime-apisSkill
- resilience-patternsSkill
- root-cause-debuggingSkill
- search-integrationSkill
- seo-and-ssrSkill
- sql-optimizationSkill
- system-designSkill
- test-strategySkill
- threat-modelingSkill
- typescript-patternsSkill
- unit-testingSkill
- verify-before-doneSkill
- web-accessibilitySkill
- web-performanceSkill
- writing-skillsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
25 rules. 0 are common, 18 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 173 edited versions we read keep these.
18
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 9
Treat every input as hostile until it is validated, check authorization on every object for every request, and use the safe API instead of …
- Distinctive: line 17
Not for: designing org-wide security policy, penetration testing third-party systems, or anything without authorization from the system …
- Distinctive: line 25
Fix at the root: use the safe API (parameterized query, auto-escaping template, allowlist).
- Distinctive: line 31
Deny by default: Every route requires authentication unless it is explicitly marked public.
- Distinctive: line 35
Check function-level permissions (admin endpoints) and field-level ones (who can see salary, PII).
- Very specific: line 54
Shell: never build a command string from input.
- Very specific: line 60
Use auto-escaping templates and frameworks, and find every escape hatch: React dangerouslySetInnerHTML, Vue v-html, Svelte {@html}, Angular …
- Distinctive: line 63
When rich HTML is required, sanitize with a maintained sanitizer (DOMPurify in browsers.
- Very specific: line 64
Add a Content Security Policy as defense in depth.
- Very specific: line 70
Prefer an allowlist of hosts.
- Distinctive: line 73
Run fetchers with no cloud credentials and network egress rules.
- Distinctive: line 74
Never return raw responses or error details from internal fetches to the user.
- Distinctive: line 78
Use the framework's or a well-maintained identity provider's authentication.
- Distinctive: line 88
No secrets in code, config committed to the repo, container images, logs, error messages or client bundles.
- Distinctive: line 94
Do not design crypto. Use high-level libraries (libsodium/NaCl, Google Tink, or your platform's AEAD APIs).
- Very specific: line 102
Never deserialize untrusted data with native object serializers: Python pickle and yaml.load (use yaml.safe_load), Java ObjectInputStream, …
- Distinctive: line 113
Fail closed: when an authorization check or validation throws, deny the request.
- Very specific: line 117
Commit lockfiles and install from them (npm ci, pip install -r with pinned hashes where possible, go.sum).
- Very specific: line 118
Run the ecosystem's vulnerability audit: npm audit, pip-audit, govulncheck ./..., cargo audit, dotnet list package --vulnerable …
- Distinctive: line 119
Check new dependencies for typosquatting, maintenance activity and install scripts before adding them.
- Distinctive: line 124
Never log passwords, tokens, session IDs, keys, full card numbers or unnecessary PII.
- Distinctive: line 125
Use structured logging so user input cannot forge log lines.
- Distinctive: line 136
Ask before running any tool that uploads code or results to a third-party service.
- Distinctive: line 151
Every entry point in scope is authenticated (or explicitly public) and checks object-level authorization.
- Distinctive: line 152
All source-to-sink paths use safe APIs.
“Common” is measured: kept by at least 6 in 10 of the 173 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 Audit
Treat every input as hostile until it is validated, check authorization on every object for every request, and use the safe API instead of the clever one. Security bugs are mostly ordinary bugs in code that crosses a trust boundary.
When to use
- Writing or changing code that handles requests, user input, authentication, authorization, files, URLs, HTML, SQL, shell commands, secrets, tokens or payments.
- Reviewing a PR for security, or before exposing an endpoint publicly.
- Triaging findings from a scanner (SAST, dependency or secret scanning).
Not for: designing org-wide security policy, penetration testing third-party systems, or anything without authorization from the system owner.
Workflow
- Map the trust boundaries. For the code in scope, list the entry points (HTTP handlers, message consumers, CLI args, file parsers, webhooks), what data comes in, and who can send it (anonymous, user, tenant admin, internal service).
- Follow untrusted data to its sinks: SQL/NoSQL queries, shell commands, HTML output, URLs fetched server-side, file paths, deserializers, templates, redirects, logs. Every source-to-sink path needs validation or a safe API.
- Check each category below that applies. Use the detailed checklist in references/checklist.md for reviews.
- Run the scanners the repo has, or the defaults in the tools table. Triage the findings; do not paste them in unfiltered.
- Fix at the root: use the safe API (parameterized query, auto-escaping template, allowlist). Do not add a blocklist filter on top of an unsafe API.
- Add a regression test for each vulnerability fixed (for example "user A gets 404 for user B's invoice").
- Report each finding with severity, location, an exploit scenario, and the fix. If you find a live secret or an actively exploitable issue in production, stop and tell the user right away. Never print the secret's value, and never test an exploit against a system you are not authorized to test.
Broken access control (the most common serious bug)
- Deny by default. Every route requires authentication unless it is explicitly marked public.
- Check ownership on every object access, server-side, using the authenticated identity, never an ID from the request body:
SELECT ... FROM invoices WHERE id = :id AND tenant_id = :current_tenant. Changing an ID in the URL must never expose someone else's data (IDOR). - Enforce authorization in the service or data layer, not only in the UI or by hiding buttons.
- Prevent mass assignment: bind requests to explicit DTOs or allowlisted fields. Never bind straight into an ORM entity that has
role,isAdmin,ownerId,priceorbalance. - Check function-level permissions (admin endpoints) and field-level ones (who can see salary, PII).
- Return 404 rather than 403 when the existence of a resource is itself sensitive.
- Validate redirects against an allowlist (open-redirect bugs enable phishing and token theft).
Injection
- SQL: parameterized queries only. Identifiers (column names in
ORDER BY, table names) cannot be parameterized, so map them through an allowlist. - ORM raw-query traps. These are safe only when used with parameters:
| Stack | Unsafe with string-built SQL | Safe form |
| Prisma | $queryRawUnsafe, $executeRawUnsafe | $queryRaw tagged template |
| EF Core | FromSqlRaw / ExecuteSqlRaw with interpolated strings | FromSql / FromSqlInterpolated, or parameters |
| SQLAlchemy | text(f"... {x}") | text("... :x") with bound params |
| Django | raw(), extra(), RawSQL with formatting | params argument |
| Sequelize / TypeORM / Knex | query(`... ${x}`), knex.raw with concatenation | replacements / bindings |
| Rails | where("name = '#{x}'") | where(name: x) or where("name = ?", x) |
| JPA / Hibernate | Concatenated JPQL/HQL | Named or positional parameters |
- Shell: never build a command string from input. Pass an argument array with no shell: Python
subprocess.run([...], shell=False), NodeexecFile/spawn(notexec), Goexec.Command(name, args...)(nosh -c), JavaProcessBuilder(List). Put--before user-supplied positional arguments. - NoSQL: reject operator objects from user input (for example
{"$gt": ""}in MongoDB queries); validate types with a schema. - Others: LDAP, XPath, template injection (never render user input as a template), header injection (CR/LF in header values), log injection.
Cross-site scripting (XSS)
- Use auto-escaping templates and frameworks, and find every escape hatch: React
dangerouslySetInnerHTML, Vuev-html, Svelte{@html}, AngularbypassSecurityTrust*, Jinja2/Django|safeandmark_safe, Handlebars{{{ }}}, EJS<%- %>, Thymeleafth:utext, RazorHtml.Raw. - DOM sinks:
innerHTML,outerHTML,insertAdjacentHTML,document.write,eval,new Function, stringsetTimeout, jQuery.html(). UsetextContentinstead. - User-controlled URLs in
href/src: allow onlyhttps:(andmailto:if needed). Blockjavascript:anddata:. - When rich HTML is required, sanitize with a maintained sanitizer (DOMPurify in browsers; nh3 for Python, since bleach is deprecated; OWASP Java HTML Sanitizer; HtmlSanitizer for .NET).
- Add a Content Security Policy as defense in depth. A strict policy uses nonces:
script-src 'nonce-{random}' 'strict-dynamic'; object-src 'none'; base-uri 'none'. Roll it out withContent-Security-Policy-Report-Onlyfirst.
Server-side request forgery (SSRF)
Applies whenever the server fetches a URL that a user influences (webhooks, URL previews, imports, image fetchers, PDF renderers).
- Prefer an allowlist of hosts. If arbitrary URLs are a feature, allow only
https(andhttpif needed) and reject anything else. - Resolve the hostname, reject private, loopback, link-local and metadata addresses (
127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,100.64.0.0/10(carrier-grade NAT),169.254.0.0/16including169.254.169.254,0.0.0.0/8,::1,fc00::/7,fe80::/10, IPv4-mapped IPv6), then connect to the IP you validated. Re-resolving lets DNS rebinding bypass the check. - Disable automatic redirects, or validate every hop.
- Run fetchers with no cloud credentials and network egress rules. On AWS, require IMDSv2.
- Never return raw responses or error details from internal fetches to the user.
Authentication and sessions
- Use the framework's or a well-maintained identity provider's authentication. Do not write your own.
- Password hashing: Argon2id (preferred), scrypt, or bcrypt (watch its 72-byte input limit); PBKDF2 only where FIPS is required. Use the parameters from the current OWASP Password Storage Cheat Sheet. Never use MD5/SHA-1/SHA-256 alone, and never encrypt passwords reversibly.
- Rate-limit and lock out progressively on login, reset and MFA endpoints. Return the same error for "unknown user" and "wrong password".
- Support MFA. Rotate the session ID on login and on privilege change. Invalidate sessions on logout and on password change.
- Cookies:
HttpOnly; Secure; SameSite=Lax(orStrict), narrowPath, the__Host-prefix where possible. - JWTs: pin the expected algorithm and reject
none; verify signature,exp,nbf,issandaudon every request; keep lifetimes short and use refresh tokens with rotation; never put secrets in the payload (it is only base64url-encoded); rotate keys viakid+ JWKS. For browser sessions, prefer HttpOnly cookies over tokens inlocalStorage. - Password-reset and magic-link tokens: random from a CSPRNG, single use, short expiry, stored hashed.
Secrets
- No secrets in code, config committed to the repo, container images, logs, error messages or client bundles. Load them at runtime from a secret manager or the environment.
- Scan with gitleaks (
gitleaks giton recent versions,gitleaks detecton older ones) and enable push protection on the hosting platform if available. - A leaked secret must be rotated. Deleting it from git history is not enough, because clones and caches keep it. Tell the user; do not rotate production credentials yourself.
Cryptography
- Do not design crypto. Use high-level libraries (libsodium/NaCl, Google Tink, or your platform's AEAD APIs).
- Symmetric encryption: AES-GCM or ChaCha20-Poly1305, with a unique nonce per key per message. Never ECB, never unauthenticated CBC.
- Randomness for tokens, IDs and keys comes from a CSPRNG only: Python
secrets, Nodecrypto.randomBytes/crypto.randomUUID, JavaSecureRandom, Gocrypto/rand, .NETRandomNumberGenerator. NeverMath.random,random, orrand. - Compare MACs and tokens in constant time: Python
hmac.compare_digest, Nodecrypto.timingSafeEqual, Gosubtle.ConstantTimeCompare, JavaMessageDigest.isEqual, .NETCryptographicOperations.FixedTimeEquals. - TLS 1.2+ everywhere, with certificate verification left on. Never ship
verify=FalseorInsecureSkipVerify: true.
Deserialization, files and paths
- Never deserialize untrusted data with native object serializers: Python
pickleandyaml.load(useyaml.safe_load), JavaObjectInputStream, .NETBinaryFormatter(obsolete; since .NET 9 it always throws), PHPunserialize, RubyMarshal. Use JSON plus schema validation. - Uploads: enforce a size limit; check type by content, not by the extension or the client's
Content-Type; generate the stored filename yourself; store outside the web root or in object storage; serve withContent-Disposition: attachmentandX-Content-Type-Options: nosniff; re-encode images; scan if the business requires it. - Paths: resolve to a canonical absolute path and check that it stays under the base directory. Check every entry when extracting archives (Zip Slip).
- XML: disable external entities and DTDs (XXE) in the parser configuration.
CSRF, headers and configuration
- Cookie-authenticated, state-changing requests need CSRF protection: the framework's anti-CSRF token plus
SameSitecookies, and anOrigincheck where available. GET never changes state. - Headers:
Strict-Transport-Security: max-age=63072000; includeSubDomains,X-Content-Type-Options: nosniff, CSP withframe-ancestors(orX-Frame-Options: DENY),Referrer-Policy: strict-origin-when-cross-origin, and a restrictivePermissions-Policy. - CORS: an explicit origin allowlist. Never reflect arbitrary origins together with
Access-Control-Allow-Credentials: true. - Production: debug mode off, default credentials changed, admin consoles not public, verbose errors off, unnecessary services and ports closed.
- Fail closed: when an authorization check or validation throws, deny the request. Never fall through to allow.
Supply chain and dependencies
- Commit lockfiles and install from them (
npm ci,pip install -rwith pinned hashes where possible,go.sum). - Run the ecosystem's vulnerability audit:
npm audit,pip-audit,govulncheck ./...,cargo audit,dotnet list package --vulnerable --include-transitive,bundle audit, OWASP Dependency-Check for Maven/Gradle. Trivy covers file systems, images and IaC (trivy fs .,trivy image <name>,trivy config .). - Check new dependencies for typosquatting, maintenance activity and install scripts before adding them. Pin CI actions and base images to digests or full SHAs.
Security logging
- Log authentication successes and failures, access denials, privilege changes and admin actions, with who, what, when and from where.
- Never log passwords, tokens, session IDs, keys, full card numbers or unnecessary PII.
- Use structured logging so user input cannot forge log lines. Alert on spikes in auth failures and access denials.
Tools
| Purpose | Tools |
| Static analysis | Semgrep (prefer explicit rulesets such as semgrep scan --config p/default), CodeQL, language linters (Bandit, gosec, eslint security plugins, SpotBugs + Find Security Bugs) |
| Secrets | gitleaks, trufflehog, platform push protection |
| Dependencies and images | Trivy, OSV-Scanner, the ecosystem audits above, Dependabot/Renovate |
| Dynamic testing (staging only, with authorization) | OWASP ZAP |
Ask before running any tool that uploads code or results to a third-party service.
Anti-patterns
- Blocklists and regex "sanitizers" in front of unsafe APIs — use parameterization, encoding and allowlists.
- Authorization in the frontend only — every API call can be made directly.
- Trusting IDs, roles or prices from the request body.
verify=False/ disabled TLS checks "just for now".- Rolling your own auth, crypto, JWT parsing or HTML sanitizer.
- Secrets in
.envfiles committed "temporarily" — assume anything ever committed is leaked. - Catch-all exception handlers that return stack traces or that skip a security check.
- Fixing the scanner finding instead of the bug — suppressing a rule without understanding it.
Done when
- Every entry point in scope is authenticated (or explicitly public) and checks object-level authorization; tests prove cross-user/cross-tenant access fails.
- All source-to-sink paths use safe APIs; no string-built SQL, shell commands or raw HTML from user input.
- Secrets, crypto, cookies, tokens and headers follow the rules above.
- Scanners were run and every finding was fixed or documented with a justification.
- Regression tests exist for every vulnerability fixed, and the user was told about any secret that must be rotated.
References
- references/checklist.md — the full checklist by OWASP Top 10 category, with review questions. Read it when doing a security review or a pre-release check.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
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.

