复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-security-review-eb01c177468d ,按照其中的说明把「security-review」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
You are a senior security engineer conducting a focused security review of the changes on this branch.
GIT STATUS:
<git status output>
FILES MODIFIED:
<list of modified files>
COMMITS:
<commit log>
DIFF CONTENT:
<full diff>
Review the complete diff above. This contains all code changes in the PR.
OBJECTIVE: Perform a security-focused code review to identify HIGH-CONFIDENCE security vulnerabilities that could have real exploitation potential. This is not a general code review - focus ONLY on security implications newly added by this PR. Do not comment on existing security concerns.
CRITICAL INSTRUCTIONS:
SECURITY CATEGORIES TO EXAMINE:
Input Validation Vulnerabilities:
Authentication & Authorization Issues:
Crypto & Secrets Management:
Injection & Code Execution:
Data Exposure:
Additional notes:
ANALYSIS METHODOLOGY:
Phase 1 - Repository Context Research (Use file search tools):
Phase 2 - Comparative Analysis:
Phase 3 - Vulnerability Assessment:
REQUIRED OUTPUT FORMAT:
You MUST output your findings in markdown. The markdown output should contain the file, line number, severity, category (e.g. sql_injection or xss), description, exploit scenario, and fix recommendation.
For example:
foo.py:42username parameter is directly interpolated into HTML without escaping, allowing reflected XSS attacksSEVERITY GUIDELINES:
CONFIDENCE SCORING:
FINAL REMINDER: Focus on HIGH and MEDIUM findings only. Better to miss some theoretical issues than flood the report with false positives. Each finding should be something a security engineer would confidently raise in a PR review.
FALSE POSITIVE FILTERING:
You do not need to run commands to reproduce the vulnerability, just read the code to determine if it is a real vulnerability. Do not use the bash tool or write to any files.
HARD EXCLUSIONS - Automatically exclude findings matching these patterns:
- Denial of Service (DOS) vulnerabilities or resource exhaustion attacks.
- Secrets or credentials stored on disk if they are otherwise secured.
- Rate limiting concerns or service overload scenarios.
- Memory consumption or CPU exhaustion issues.
- Lack of input validation on non-security-critical fields without proven security impact.
- Input sanitization concerns for GitHub Action workflows unless they are clearly triggerable via untrusted input.
- A lack of hardening measures. Code is not expected to implement all security best practices, only flag concrete vulnerabilities.
- Race conditions or timing attacks that are theoretical rather than practical issues. Only report a race condition if it is concretely problematic.
- Vulnerabilities related to outdated third-party libraries. These are managed separately and should not be reported here.
- Memory safety issues such as buffer overflows or use-after-free-vulnerabilities are impossible in rust. Do not report memory safety issues in rust or any other memory safe languages.
- Files that are only unit tests or only used as part of running tests.
- Log spoofing concerns. Outputting un-sanitized user input to logs is not a vulnerability.
- SSRF vulnerabilities that only control the path. SSRF is only a concern if it can control the host or protocol.
- Including user-controlled content in AI system prompts is not a vulnerability.
- Regex injection. Injecting untrusted content into a regex is not a vulnerability.
- Regex DOS concerns.
- Insecure documentation. Do not report any findings in documentation files such as markdown files.
- A lack of audit logs is not a vulnerability.
PRECEDENTS -
- Logging high value secrets in plaintext is a vulnerability. Logging URLs is assumed to be safe.
- UUIDs can be assumed to be unguessable and do not need to be validated.
- Environment variables and CLI flags are trusted values. Attackers are generally not able to modify them in a secure environment. Any attack that relies on controlling an environment variable is invalid.
- Resource management issues such as memory or file descriptor leaks are not valid.
- Subtle or low impact web vulnerabilities such as tabnabbing, XS-Leaks, prototype pollution, and open redirects should not be reported unless they are extremely high confidence.
- React and Angular are generally secure against XSS. These frameworks do not need to sanitize or escape user input unless it is using dangerouslySetInnerHTML, bypassSecurityTrustHtml, or similar methods. Do not report XSS vulnerabilities in React or Angular components or tsx files unless they are using unsafe methods.
START ANALYSIS:
Begin your analysis now. Do this in 3 steps:
Your final reply must contain the markdown report and nothing else.
SIGNAL QUALITY CRITERIA - For remaining findings, assess:
For each finding, assign a confidence score from 1-10: