OWASP Top 10 Security Audit

Audit code for the OWASP Top 10 with exploitability-ranked findings: concrete attack scenario, affected lines, and the minimal fix.

Security-audit the code below. You are looking for exploitable vulnerabilities, not style issues: every finding needs an attack story.

Code (routes/handlers, auth logic, DB access, file handling: the attack surface):
"""
[PASTE CODE, or point an agent at the repo and name the entry points]
"""

Context: [STACK + WHERE THIS RUNS, e.g. "Express API, public internet, JWT auth" / "internal Django admin"]
What's sensitive here: [THE DATA/ACTIONS AN ATTACKER WOULD WANT: PII, payments, admin functions]

Audit systematically against each class, reporting only what applies:
1. **Injection**: SQL/NoSQL built by string concatenation, shell commands from user input, unsanitized HTML (XSS), template injection. Parameterization present everywhere?
2. **Broken auth & session**: password handling, token generation/expiry/storage, session fixation, missing rate limits on login/reset endpoints.
3. **Broken access control**: the highest-yield class: endpoints missing authorization (not just authentication), IDOR (can user A fetch /orders/123 belonging to user B?: check EVERY id-taking route), privilege checks done client-side only, mass assignment.
4. **Sensitive data exposure**: secrets in code/config/logs, PII in error messages or URLs, missing encryption where the context demands it.
5. **Security misconfiguration**: permissive CORS, missing security headers, debug modes, default credentials, verbose stack traces to clients.
6. **SSRF & unsafe deserialization**: user-supplied URLs fetched server-side, pickle/eval/yaml.load on external input.
7. **Vulnerable dependencies**: flag imports with known-vulnerable patterns; recommend a lockfile audit command for my stack.

For each finding:
- **Severity** (critical / high / medium / low) ranked by exploitability × impact on my stated sensitive assets, not theoretical purity.
- **Location**: file:line.
- **Attack scenario**: the concrete steps an attacker takes, with an example payload where safe to show.
- **Fix**: the minimal code change, written out, plus the pattern that prevents the class ("parameterize everywhere", not just this instance).

Rules: only report findings you can defend with an attack path, a hypothetical without a route to exploitation is a note, not a finding (put those in a short "hardening suggestions" list at the end). If an area looks clean, say what you checked and found sound. End with the top 3 fixes by risk-reduction-per-hour.

How to use

Broken access control is #1 on OWASP's list for a reason. IDOR checks on every id-taking endpoint routinely find real holes that scanners miss, which is why this prompt weights it. An AI audit complements but doesn't replace SAST tooling and a human pentest for anything handling money or PII: use this as the fast first pass and before every major release. In an agentic tool, let it walk the routes directory itself.

Originated fromStan SedberryUpdated
Code reviewadvanced

More coding prompts

Write the commit message for this change.

Diff:
"""
[PASTE THE STAGED DIFF]
"""

Why I made this change: [THE REASON, THE TICKET, THE BUG REPORT, or "you infer it"]
Convention: [Conventional Commits / this repo's existing style, pasted below / plain]
Recent commits from this repo, to match style:
"""
[PASTE 5-10 RECENT COMMIT SUBJECT LIN

Commit Message

Write a commit message that explains why the change was made, in Conventional Commits format, split into separate commits when needed.

Codingbeginner
Help me recover from a git mistake without making it worse.

What I was trying to do: [THE GOAL]
What I ran: [THE EXACT COMMANDS, IN ORDER]
What happened instead: [THE OUTPUT OR THE STATE NOW]
Has this been pushed or shared: [YES/NO, and to which branch and whether anyone else has pulled]
Uncommitted work I cannot lose: [WHAT AND WHERE, o

Undo a Git Mistake

Recover from a bad commit, force push, wrong branch, or lost work with a reversible plan and the exact commands, explained before you run them.

Codingintermediate
Handler code, routes, and models:
"""
[PASTE THE ROUTE DEFINITIONS, HANDLERS, REQUEST AND RESPONSE TYPES, VALIDATION SCHEMAS, AND MIDDLEWARE]
"""

Generate an OpenAPI 3.1 specification from the code above.

API name, version, and base URL: [DETAILS]
Auth scheme: [BEARER JWT / API KEY / OAUTH / SESSION COOKIE, and where it is enforced]
Con

OpenAPI Spec From Code

Generate an accurate OpenAPI 3.1 spec from handler code, including error responses and auth, with gaps flagged instead of invented.

Codingintermediate

Search prompts

Find a prompt by title, description, tag, or category.