Security PR Review
Purpose
Review changed code with a security-review mindset: prioritize introduced bugs, exploitable regressions,
and missing coverage in the modified attack surface. Focus on what the diff changes, not on writing a
general audit of the whole repository.
Scope Rules
- Prioritize vulnerabilities introduced or exposed by the diff.
- Inspect surrounding code when needed to confirm reachability, auth context, or sanitizer behavior.
- Mention pre-existing issues only when the change makes them reachable, worse, or security-relevant now.
- Findings come first; summary is secondary.
Workflow
Step 1: Read the Diff as an Attack Surface Change
Identify:
- newly added endpoints, handlers, controllers, jobs, or CLI paths
- changed authorization checks or middleware wiring
- new deserialization, template rendering, file, network, or command execution paths
- config changes that weaken defaults or widen trust boundaries
Step 2: Map New Sources, Sinks, and Guards
For changed code, locate:
- attacker-controlled inputs
- dangerous sinks
- sanitization, validation, auth, and feature-flag guards
Do not stop at the edited hunk if the actual sink or protection lives nearby.
Step 3: Trace Security-Sensitive Data Flow
Apply lightweight taint reasoning through:
- helper calls
- serializers and DTOs
- middleware layers
- ORM/query helpers
- template/view rendering
- background job enqueue/dequeue boundaries
Step 4: Review Diff-Specific Risk Patterns
Pay extra attention to:
- string-built queries, filters, or shell commands
- unsafe deserialization, polymorphic typing, object revival, or parser feature flags
- auth checks moved later in the flow
- newly trusted headers, cookies, or client-supplied role fields
- open redirects added through
next, returnTo, or redirect_url
- debug logging of secrets, tokens, or PII
- upload handling, archive extraction, or path joins
- new outbound HTTP fetches or webhook callbacks
- security settings changed from strict to permissive
Step 5: Judge Before Reporting
For every candidate finding, verify:
- the input is actually attacker-controlled
- the changed path is reachable
- protections are not already effective
- the issue is materially exploitable
Drop speculative findings that cannot survive this check.
Step 6: Report Findings and Testing Gaps
Report confirmed issues with:
- severity
- exact changed file and line
- exploit path in one short paragraph
- concrete remediation direction
- missing test coverage if the diff should have added one
If no confirmed issue exists, say so explicitly and note any residual uncertainty or testing gaps.
Review Guardrails
- Do not file a security finding purely because code "looks risky"; explain the actual exploit path.
- Do not ignore new trust boundaries just because the sink is in an unchanged helper.
- Do not report infra-only assumptions as app bugs unless the diff depends on them.
- Do not downgrade auth bugs simply because the endpoint is "internal" without evidence.
- Do not confuse code-quality concerns with security findings unless they create exploitability.
Output Format
Use this structure:
[SEVERITY] <short title>
File: <path>:<line>
Why it matters: <reachability + impact in 2-4 sentences>
Fix: <specific remediation>
Tests: <missing or recommended coverage>
When there are no findings:
No confirmed security findings in the reviewed diff.
Residual risk: <short note or "none identified">
Testing gap: <short note or "none identified">
1---
2name: eresus-pr-security-review
3description: >
4 Security-focused pull request and diff review skill for finding newly introduced vulnerabilities, risky regressions,
5 and missing security tests in changed code. Trigger when the user asks to: "review this PR for security", "check this diff for vulns",
6 "do a security code review", "audit changed files", or wants findings on a patch instead of a full-repo scan. Best used alongside eresus-sast-scanner.
7metadata:
8 source: https://skillmd.com/skills/aibot88/eresus-pr-security-review
9 version: "1.0"
10 domain: application-security
11 mode: review
12---
13
14# Security PR Review
15
16## Purpose
17
18Review changed code with a security-review mindset: prioritize introduced bugs, exploitable regressions,
19and missing coverage in the modified attack surface. Focus on what the diff changes, not on writing a
20general audit of the whole repository.
21
22## Scope Rules
23
24- Prioritize vulnerabilities introduced or exposed by the diff.
25- Inspect surrounding code when needed to confirm reachability, auth context, or sanitizer behavior.
26- Mention pre-existing issues only when the change makes them reachable, worse, or security-relevant now.
27- Findings come first; summary is secondary.
28
29---
30
31## Workflow
32
33### Step 1: Read the Diff as an Attack Surface Change
34
35Identify:
36
37- newly added endpoints, handlers, controllers, jobs, or CLI paths
38- changed authorization checks or middleware wiring
39- new deserialization, template rendering, file, network, or command execution paths
40- config changes that weaken defaults or widen trust boundaries
41
42### Step 2: Map New Sources, Sinks, and Guards
43
44For changed code, locate:
45
46- attacker-controlled inputs
47- dangerous sinks
48- sanitization, validation, auth, and feature-flag guards
49
50Do not stop at the edited hunk if the actual sink or protection lives nearby.
51
52### Step 3: Trace Security-Sensitive Data Flow
53
54Apply lightweight taint reasoning through:
55
56- helper calls
57- serializers and DTOs
58- middleware layers
59- ORM/query helpers
60- template/view rendering
61- background job enqueue/dequeue boundaries
62
63### Step 4: Review Diff-Specific Risk Patterns
64
65Pay extra attention to:
66
67- string-built queries, filters, or shell commands
68- unsafe deserialization, polymorphic typing, object revival, or parser feature flags
69- auth checks moved later in the flow
70- newly trusted headers, cookies, or client-supplied role fields
71- open redirects added through `next`, `returnTo`, or `redirect_url`
72- debug logging of secrets, tokens, or PII
73- upload handling, archive extraction, or path joins
74- new outbound HTTP fetches or webhook callbacks
75- security settings changed from strict to permissive
76
77### Step 5: Judge Before Reporting
78
79For every candidate finding, verify:
80
81- the input is actually attacker-controlled
82- the changed path is reachable
83- protections are not already effective
84- the issue is materially exploitable
85
86Drop speculative findings that cannot survive this check.
87
88### Step 6: Report Findings and Testing Gaps
89
90Report confirmed issues with:
91
92- severity
93- exact changed file and line
94- exploit path in one short paragraph
95- concrete remediation direction
96- missing test coverage if the diff should have added one
97
98If no confirmed issue exists, say so explicitly and note any residual uncertainty or testing gaps.
99
100---
101
102## Review Guardrails
103
104- Do not file a security finding purely because code "looks risky"; explain the actual exploit path.
105- Do not ignore new trust boundaries just because the sink is in an unchanged helper.
106- Do not report infra-only assumptions as app bugs unless the diff depends on them.
107- Do not downgrade auth bugs simply because the endpoint is "internal" without evidence.
108- Do not confuse code-quality concerns with security findings unless they create exploitability.
109
110---
111
112## Output Format
113
114Use this structure:
115
116```markdown
117[SEVERITY] <short title>
118File: <path>:<line>
119Why it matters: <reachability + impact in 2-4 sentences>
120Fix: <specific remediation>
121Tests: <missing or recommended coverage>
122```
123
124When there are no findings:
125
126```markdown
127No confirmed security findings in the reviewed diff.
128Residual risk: <short note or "none identified">
129Testing gap: <short note or "none identified">
130```