Audit a codebase or a change for security flaws with a short threat model and a fixed checklist, and return findings ranked by severity, each with an exploit scenario and a fix. Use for "security audit", "check for vulnerabilities", "is this safe to expose", "review auth and permissions".
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Security Audit?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/kinzarra-security-audit)
---
name: security-audit
description: Audit a codebase or a change for security flaws with a short threat model and a fixed checklist, and return findings ranked by severity, each with an exploit scenario and a fix. Use for "security audit", "check for vulnerabilities", "is this safe to expose", "review auth and permissions".
---
# Security audit
The result is a ranked list of real, reachable weaknesses, each with the path an attacker takes and the change that closes it. The audit is read-only unless the task asks for fixes.
## 1. Threat model, in half a page
- **Assets**: what is worth stealing or breaking (accounts, personal data, payments, secrets, the host itself, availability).
- **Entry points**: every place where outside data enters. Routes and handlers, forms, file uploads, webhooks, queues, command-line arguments, scheduled imports, admin panels, debug endpoints.
- **Actors**: anonymous visitor, signed-in user, user of another tenant, administrator, a compromised dependency or integration.
- **Trust boundaries**: where data crosses from less trusted to more trusted, and what checks it there.
- Pick the 5 to 10 entry points that lead to the most valuable assets and audit those first and deepest. State the scope in the report.
## 2. Check, in this order
1. **Authentication**: password storage (a slow salted hash), session and token lifetime, rotation and revocation, token signature and algorithm checks, reset and invitation flows (single use, expiry, no account enumeration), limits on login attempts, default or hard-coded accounts.
2. **Authorization**: for every entry point, where the permission check is. Object-level checks (can this user act on this identifier, not only "is signed in"), tenant isolation in every query, role checks on the server and not only in the interface, mass assignment of fields such as role or owner, admin functions reachable by a guessed address.
3. **Input and injection**: follow input to each sink. Queries built by string concatenation, shell commands, template rendering, dynamic evaluation, deserialization of untrusted data, expressions and selectors, XML with external entities, regular expressions with catastrophic backtracking, missing size and type limits.
4. **Secrets**: keys, tokens and passwords in the code, configuration samples, tests, history, build files, container images, client bundles. Secrets with broader rights than needed. Report by file and line and by name; never copy the value.
5. **Dependencies**: run the ecosystem's audit command when one exists; check the lock file, pinned versions, abandoned packages, packages pulled from unusual sources, install scripts.
6. **Files and paths**: user-controlled names joined into paths (traversal), archive extraction, upload type and size checks, where uploads are stored and whether they can be executed or served as active content, temporary files, file permissions.
7. **Outbound requests (SSRF)**: any address that comes from the user (fetchers, webhooks, previews, importers). Is there an allowlist, are internal and metadata addresses blocked after name resolution and after every redirect.
8. **Browser-side**: output encoding by context (XSS), raw markup insertion, content security policy, CSRF protection on state-changing requests, cookie flags (secure, not readable by scripts, same-site), cross-origin rules with credentials, open redirects, framing.
9. **Sensitive data in logs and errors**: passwords, tokens, personal data and full request bodies in logs, analytics or error trackers; stack traces and internal details in responses; debug mode in production settings.
10. **Transport and configuration**: encryption in transit, security headers, permissive defaults, exposed management ports, weak or home-made cryptography, predictable random values used for tokens.
## 3. Prove each finding
- Trace the path from the entry point to the sink in the code and name every file and line on it. Check for a control further up (middleware, a framework default, a gateway) before reporting.
- State the precondition: which actor, which access, which input.
- Confirm by reading and, when safe, by a local test in the worktree against local data only. Never attack a deployed or shared system, never touch third-party services, never use found credentials.
- A scanner hit is a lead, not a finding. Report it only after the path is confirmed; otherwise list it under "unconfirmed".
## 4. Severity
- **Critical**: an anonymous or ordinary user reaches other users' data, takes over an account, runs code, or reads secrets. Fix before any release.
- **High**: the same, but needing a specific condition or a privileged account; lasting XSS; missing authorization on a write.
- **Medium**: limited data exposure, weaknesses that need a second flaw to matter, missing rate limits on sensitive actions.
- **Low**: hardening and defence in depth.
Rank inside a level by how easy the attack is and how many users it touches.
## 5. Report
1. **Verdict** in 3 to 5 sentences: the worst thing found and what to do first.
2. **Scope and method**: what was audited, the commands run, what was out of scope.
3. **Findings**, most severe first. Each: severity, title, location (file:line), the exploit scenario step by step, the impact, the fix (the exact change and where), how to verify the fix.
4. **Unconfirmed leads**, with what would confirm them.
5. **Good controls found**, briefly, so that they are not removed later.
6. **Unknowns**: what could not be checked and which access would close the gap.
Rules: read-only unless the task asks to fix; when fixing, one finding per change with a test that fails before the fix. Never print a secret, a token or personal data; give the location and the name. A leaked secret is reported as "rotate it", not only "remove it". Do not commit or push unless the task says so. Do not write working exploit tooling beyond the minimal proof needed.