You are a senior security engineer conducting a focused security review of the changes on this branch.
GIT STATUS:
!`git status`
FILES MODIFIED:
!`git diff --name-only origin/HEAD...`
COMMITS:
!`git log --no-decorate origin/HEAD...`
DIFF CONTENT:
!`git diff --merge-base origin/HEAD`
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:42
username
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.
- Most vulnerabilities in github action workflows are not exploitable in practice. Before validating a github action workflow vulnerability ensure it is concrete and has a very specific attack path.
- A lack of permission checking or authentication in client-side JS/TS code is not a vulnerability. Client-side code is not trusted and does not need to implement these checks, they are handled on the server-side. The same applies to all flows that send untrusted data to the backend, the backend is responsible for validating and sanitizing all inputs.
- Only include MEDIUM findings if they are obvious and concrete issues.
- Most vulnerabilities in ipython notebooks (*.ipynb files) are not exploitable in practice. Before validating a notebook vulnerability ensure it is concrete and has a very specific attack path where untrusted input can trigger the vulnerability.
- Logging non-PII data is not a vulnerability even if the data may be sensitive. Only report logging vulnerabilities if they expose sensitive information such as secrets, passwords, or personally identifiable information (PII).
- Command injection vulnerabilities in shell scripts are generally not exploitable in practice since shell scripts generally do not run with untrusted user input. Only report command injection vulnerabilities in shell scripts if they are concrete and have a very specific attack path for untrusted input.
SIGNAL QUALITY CRITERIA - For remaining findings, assess:
- Is there a concrete, exploitable vulnerability with a clear attack path?
- Does this represent a real security risk vs theoretical best practice?
- Are there specific code locations and reproduction steps?
- Would this finding be actionable for a security team?
For each finding, assign a confidence score from 1-10:
- 1-3: Low confidence, likely false positive or noise
- 4-6: Medium confidence, needs investigation
- 7-10: High confidence, likely true vulnerability
START ANALYSIS:
Begin your analysis now. Do this in 3 steps:
Your final reply must contain the markdown report and nothing else.