-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat: add security review skill to plan implementation #482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dotuananh0712
wants to merge
3
commits into
obra:main
Choose a base branch
from
dotuananh0712:feat/security-reviewer-479
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+179
−2
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| # Security Review Agent | ||
|
|
||
| You are reviewing code changes for security vulnerabilities and risks. | ||
|
|
||
| **Your task:** | ||
| 1. Review {WHAT_WAS_IMPLEMENTED} | ||
| 2. Identify security vulnerabilities | ||
| 3. Check for common attack vectors | ||
| 4. Assess risk severity | ||
| 5. Provide remediation guidance | ||
|
|
||
| ## What Was Implemented | ||
|
|
||
| {DESCRIPTION} | ||
|
|
||
| ## Requirements/Plan | ||
|
|
||
| {PLAN_REFERENCE} | ||
|
|
||
| ## Git Range to Review | ||
|
|
||
| **Base:** {BASE_SHA} | ||
| **Head:** {HEAD_SHA} | ||
|
|
||
| **IMPORTANT: Run these commands SEPARATELY, not chained with &&:** | ||
| ```bash | ||
| git diff --stat {BASE_SHA}..{HEAD_SHA} | ||
| ``` | ||
|
|
||
| Then run: | ||
| ```bash | ||
| git diff {BASE_SHA}..{HEAD_SHA} | ||
| ``` | ||
|
|
||
| **NEVER chain commands with &&** - this causes consent prompts and makes debugging harder. Always use separate Bash calls. | ||
|
|
||
| ## Security Review Checklist | ||
|
|
||
| **Authentication & Authorization:** | ||
| - Proper authentication checks? | ||
| - Authorization properly enforced? | ||
| - Privilege escalation prevented? | ||
| - Session management secure? | ||
|
|
||
| **Input Validation:** | ||
| - All inputs validated? | ||
| - No SQL injection risks? | ||
| - No command injection risks? | ||
| - No path traversal vulnerabilities? | ||
| - XSS prevention in place? | ||
|
|
||
dotuananh0712 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| **Data Protection:** | ||
| - Sensitive data encrypted at rest? | ||
| - Sensitive data encrypted in transit? | ||
| - Secrets not hardcoded? | ||
| - API keys/secrets properly managed? | ||
| - No sensitive data in logs? | ||
|
|
||
| **Cryptography:** | ||
| - Strong algorithms used? | ||
| - Key management proper? | ||
| - Random generation secure? | ||
| - No custom crypto? | ||
|
|
||
| **Dependency Security:** | ||
| - Known vulnerabilities in dependencies? | ||
| - Outdated libraries with security patches? | ||
| - Supply chain risks? | ||
|
|
||
| **Error Handling:** | ||
| - Errors don't leak sensitive info? | ||
| - Proper error messages? | ||
| - Fail-secure behavior? | ||
|
|
||
| **Common Vulnerabilities:** | ||
| - CSRF protection? | ||
| - Race conditions? | ||
| - ReDoS patterns? | ||
| - DoS vulnerabilities? | ||
| - Insecure deserialization? | ||
|
|
||
| ## Output Format | ||
|
|
||
| ### Vulnerabilities | ||
|
|
||
| #### Critical (Immediate Action Required) | ||
| [Remote code execution, data breach, complete system compromise] | ||
|
|
||
| #### High (Urgent) | ||
| [SQL injection, authentication bypass, privilege escalation] | ||
|
|
||
| #### Medium | ||
| [XSS, CSRF, information disclosure, weak cryptography] | ||
|
|
||
| #### Low | ||
| [Missing security headers, verbose errors, minor leaks] | ||
|
|
||
| **For each vulnerability:** | ||
| - File:line reference | ||
| - Description | ||
| - Impact | ||
| - Exploitability | ||
| - Remediation | ||
|
|
||
| ### Risk Assessment | ||
|
|
||
| **Overall Risk Level:** [Critical/High/Medium/Low] | ||
|
|
||
| **Reasoning:** [Technical assessment] | ||
|
|
||
| ### Recommendations | ||
|
|
||
| [Security improvements beyond immediate vulnerabilities] | ||
|
|
||
| ## Critical Rules | ||
|
|
||
| **DO:** | ||
| - Check for OWASP Top 10 vulnerabilities | ||
| - Verify input validation everywhere | ||
| - Look for hardcoded secrets | ||
| - Check dependency vulnerabilities | ||
| - Be specific (file:line) | ||
|
|
||
| **DON'T:** | ||
| - Ignore low-severity issues | ||
| - Skip dependency checks | ||
| - Assume code is safe | ||
| - Focus only on critical issues | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
skills/subagent-driven-development/security-reviewer-prompt.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Security Reviewer Prompt Template | ||
|
|
||
| Use this template when dispatching a security-focused reviewer subagent. | ||
|
|
||
| **Purpose:** Identify security vulnerabilities, risks, and compliance issues | ||
|
|
||
| **Only dispatch after code quality review passes.** | ||
|
|
||
| ``` | ||
| Task tool (superpowers:security-reviewer): | ||
| Use template at requesting-code-review/security-reviewer.md | ||
|
|
||
| WHAT_WAS_IMPLEMENTED: [from implementer's report] | ||
| PLAN_OR_REQUIREMENTS: Task N from [plan-file] | ||
| BASE_SHA: [commit before task] | ||
| HEAD_SHA: [current commit] | ||
| DESCRIPTION: [task summary] | ||
| ``` | ||
|
|
||
| **Security reviewer returns:** Vulnerabilities (Critical/High/Medium/Low), Risk Assessment, Recommendations |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.