Audit a Pull Request Diff for Security Flaws and Auth Bypasses
Get a line-by-line PR security review mapping each flaw to an OWASP category, concrete abuse scenario, and minimal drop-in code patch.
Agent prompt for ChatGPT and Claude
You get: Summary table with columns, numbered finding sections and verification checklist with 2 to 3 targeted tests to…
Prompt
mkdir -p .agents/skills/audit-a-pull-request-diff-for-security-flaws-and-auth-bypasses && curl -sL "https://prompts-gpt.com/prompts/audit-a-pull-request-diff-for-security-flaws-and-auth-bypasses/raw" -o .agents/skills/audit-a-pull-request-diff-for-security-flaws-and-auth-bypasses/SKILL.mdAct as a principal application security engineer reviewing a production pull request. I will paste a git diff right after this prompt. Audit the changed lines for authentication bypasses, broken access control, injection flaws, secret leaks, and unsafe deserialization.
Rules:
1. Report only concrete issues visible in the diff; skip generic security checklists and style advice.
2. Map every finding to a specific OWASP Top 10 category and cite the exact file path and line number from the diff.
3. Explain the realistic abuse scenario in two sentences so a developer understands the business impact without guesswork.
4. Provide a minimal drop-in code patch for each finding that preserves existing behavior for authorized users.
5. Rank findings from Critical to Low severity; if no real security flaw exists, state that clearly instead of inventing one.
Output format:
- Summary table with columns: Severity, File and Line, OWASP Category, Issue.
- Numbered finding sections, each containing: Impact and Abuse Scenario, and Minimal Patch in a fenced code block.
- Verification checklist with 2 to 3 targeted tests to confirm the fixes.
End with one short paragraph noting any security assumptions that depend on unseen middleware, database rules, or gateway configs.Example output
Tips and common edits
Why this works
- Requiring exact file paths, line numbers, and OWASP categories prevents vague, generic security checklists.
- Pairing a two-sentence abuse scenario with a minimal drop-in patch makes each finding immediately actionable in PR comments.
- Explicitly allowing a clean pass stops the model from hallucinating minor style nitpicks as security bugs.
Paste this into GitHub Copilot Chat, Claude, or ChatGPT right before your git diff when reviewing auth, billing, or API pull requests. Include surrounding route middleware if available.
Common edits
- Add a rule to flag compliance-specific risks like PII logging or missing audit trails for HIPAA or SOC 2 repos.
- Specify your test framework, such as pytest or Jest, in the verification checklist so the model outputs ready-to-run test cases.
Reuse it: Use in a workflowAdapt in the builder
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
More like this
Pre-Merge Self-Review of a Git Diff: Correctness, Security, and Test Gaps
Has Claude Code review a branch diff like a skeptical maintainer, producing severity-ranked findings with evidence and a clear merge, fix, or block recommendation. Use it before opening or approving a pull request.
Codex Pre-Merge Diff Review with Severity-Ranked Findings
Has Codex review a branch diff against a base ref in read-only mode. It checks correctness, tests, security, and maintainability, and returns evidence-backed findings with severity and a merge recommendation.
Audit a Pull Request Diff for Breaking API Changes
Separates wire-breaking schema, status code, and migration changes from safe additions, returning a consumer impact table and deprecation plan.
Security Review of a Code Snippet: Ranked Findings With Exploit Path and Fix
Reviews pasted code for injection, broken authorization, secrets, SSRF and similar flaws, and returns only real findings ranked by severity, each with a one-line exploit path and fixed code.
Pull Request Review with Merge Recommendation
Reviews a diff against your standards and returns a merge, merge-with-changes, or do-not-merge recommendation. Findings are ranked by severity, with evidence, suggested fixes, and open questions.
Pre-PR Self-Review and Pull Request Description from a Git Diff
Has GitHub Copilot review your branch diff against the base branch, flag defects and missing tests, and draft a PR description with evidence. Use it to decide whether to open the PR or fix issues first.