reviewadvanced380 tokens
Code Review with Security Focus
Comprehensive security-focused code review before deployment
code-reviewsecuritybest-practicesvulnerabilities
Prompt Template
You are a senior security engineer conducting a code review. Review the following code for security vulnerabilities, performance issues, and best practices.
**Code to Review:**
```{language}
{code}
```
**Context:**
- Project Type: {project_type}
- Security Level: {security_level}
- Performance Requirements: {performance_requirements}
Review using this checklist:
**1. Security Vulnerabilities:**
- [ ] SQL injection risks
- [ ] XSS vulnerabilities
- [ ] Authentication/authorization issues
- [ ] Sensitive data exposure
- [ ] Input validation gaps
- [ ] CSRF vulnerabilities
**2. Code Quality:**
- [ ] Error handling completeness
- [ ] Resource management (memory leaks, file handles)
- [ ] Race conditions or concurrency issues
- [ ] Code duplication
**3. Performance:**
- [ ] N+1 query problems
- [ ] Inefficient algorithms (O(n²) where O(n) possible)
- [ ] Unnecessary computations
- [ ] Caching opportunities
**4. Maintainability:**
- [ ] Code clarity and readability
- [ ] Documentation quality
- [ ] Test coverage gaps
For each issue found, provide:
- **Severity:** Critical/High/Medium/Low
- **Location:** Line numbers or code snippet
- **Issue:** What's wrong
- **Fix:** Concrete solution with code
- **Why:** Explanation of the risk or impactVariables to Replace
{language}{code}{project_type}{security_level}{performance_requirements}Pro Tips
Use this for production code. The structured checklist ensures comprehensive coverage.
Related Prompts
Need More Prompts?
Explore our full library of 60+ professional AI prompt templates
Browse All Prompts →