OWASP Top 10 Security Reviewer
This skill is designed to perform a comprehensive security code review based on the OWASP Top 10 vulnerabilities. Use this skill when the user asks for a security audit, code review for vulnerabilities, or specifically mentions OWASP.
Core Mandates
- Prioritize Critical Vulnerabilities: Focus on high-impact issues that could lead to data breaches or system compromise.
- Context-Aware Analysis: Understand the language, framework, and deployment context to identify relevant threats (e.g., SQL injection is relevant for SQL databases, XSS for web frontends).
- Actionable Remediation: Provide clear, specific code examples or configuration changes to fix identified issues.
- No False Positives: Verify findings to the best of your ability. If unsure, mark as "Potential" or "Requires Manual Verification".
OWASP Top 10 Checklist
When reviewing code, systematically check for the following categories:
A01:2021-Broken Access Control
- Check for missing authorization checks (e.g.,
is_admin, has_permission).
- Look for Insecure Direct Object References (IDOR) - exposing internal IDs in URLs/APIs without validation.
- Verify that restricted pages/endpoints are protected.
A02:2021-Cryptographic Failures
- Identify hardcoded secrets (API keys, passwords, tokens).
- Check for weak encryption algorithms (e.g., MD5, SHA1, DES).
- Ensure sensitive data (PII, passwords) is not stored or transmitted in plain text.
- Verify proper use of random number generators (CSPRNG).
A03:2021-Injection
- SQL Injection: Look for string concatenation in SQL queries. Ensure parameterized queries or ORMs are used correctly.
- Command Injection: Check for user input being passed to system commands (e.g.,
os.system, exec).
- LDAP/NoSQL Injection: Verify input sanitization for other data stores.
A04:2021-Insecure Design
- Assess if the architecture inherently supports security (e.g., threat modeling).
- Look for lack of rate limiting or anti-automation defenses.
A05:2021-Security Misconfiguration
- Check for default credentials or configurations.
- Look for verbose error messages exposing stack traces to users.
- Verify security headers (CSP, HSTS, X-Frame-Options).
- Check for unnecessary features or services enabled.
A06:2021-Vulnerable and Outdated Components
- Check
package.json, requirements.txt, etc., for known vulnerable dependencies (if version info is available).
- Advise on updating dependencies.
A07:2021-Identification and Authentication Failures
- Check for weak password policies.
- Verify session management (timeouts, secure cookies).
- Look for lack of multi-factor authentication (MFA) support where appropriate.
A08:2021-Software and Data Integrity Failures
- Verify code signing or integrity checks for updates/plugins.
- Check for insecure deserialization vulnerabilities (e.g.,
pickle.load in Python, ObjectInputStream in Java) with untrusted data.
A09:2021-Security Logging and Monitoring Failures
- Ensure critical events (logins, failed access, errors) are logged.
- Verify logs do not contain sensitive data.
A10:2021-Server-Side Request Forgery (SSRF)
- Check if user-supplied URLs are fetched by the server without validation (allowlisting).
Review Process & Output Format
- Analyze: Read the provided code thoroughly.
- Identify: Match patterns to the OWASP categories above.
- Report: specific findings using the format below.
Output Format
## Security Review Report (OWASP Top 10)
### Summary
[Brief overview of the security posture of the reviewed code.]
### Findings
#### [High/Medium/Low] <Vulnerability Name> (OWASP Category)
* **Location:** `path/to/file:line_number`
* **Description:** [Explain why this is a vulnerability.]
* **Remediation:** [Provide code fix or specific instruction.]
```language
// Secure code example
```
... (Repeat for other findings)
### General Recommendations
* [Broader security advice not tied to a specific line of code]
1---2name: security-review3description: Perform a security code review based on OWASP Top 10. Use when user asks for security audit, vulnerability review, or mentions OWASP. Triggers on "security review", "audit code", "check for vulnerabilities", "OWASP", "kiểm tra bảo mật".4---56# OWASP Top 10 Security Reviewer78This skill is designed to perform a comprehensive security code review based on the OWASP Top 10 vulnerabilities. Use this skill when the user asks for a security audit, code review for vulnerabilities, or specifically mentions OWASP.910## Core Mandates11121. **Prioritize Critical Vulnerabilities:** Focus on high-impact issues that could lead to data breaches or system compromise.132. **Context-Aware Analysis:** Understand the language, framework, and deployment context to identify relevant threats (e.g., SQL injection is relevant for SQL databases, XSS for web frontends).143. **Actionable Remediation:** Provide clear, specific code examples or configuration changes to fix identified issues.154. **No False Positives:** Verify findings to the best of your ability. If unsure, mark as "Potential" or "Requires Manual Verification".1617## OWASP Top 10 Checklist1819When reviewing code, systematically check for the following categories:20211. **A01:2021-Broken Access Control**22 * Check for missing authorization checks (e.g., `is_admin`, `has_permission`).23 * Look for Insecure Direct Object References (IDOR) - exposing internal IDs in URLs/APIs without validation.24 * Verify that restricted pages/endpoints are protected.25262. **A02:2021-Cryptographic Failures**27 * Identify hardcoded secrets (API keys, passwords, tokens).28 * Check for weak encryption algorithms (e.g., MD5, SHA1, DES).29 * Ensure sensitive data (PII, passwords) is not stored or transmitted in plain text.30 * Verify proper use of random number generators (CSPRNG).31323. **A03:2021-Injection**33 * **SQL Injection:** Look for string concatenation in SQL queries. Ensure parameterized queries or ORMs are used correctly.34 * **Command Injection:** Check for user input being passed to system commands (e.g., `os.system`, `exec`).35 * **LDAP/NoSQL Injection:** Verify input sanitization for other data stores.36374. **A04:2021-Insecure Design**38 * Assess if the architecture inherently supports security (e.g., threat modeling).39 * Look for lack of rate limiting or anti-automation defenses.40415. **A05:2021-Security Misconfiguration**42 * Check for default credentials or configurations.43 * Look for verbose error messages exposing stack traces to users.44 * Verify security headers (CSP, HSTS, X-Frame-Options).45 * Check for unnecessary features or services enabled.46476. **A06:2021-Vulnerable and Outdated Components**48 * Check `package.json`, `requirements.txt`, etc., for known vulnerable dependencies (if version info is available).49 * Advise on updating dependencies.50517. **A07:2021-Identification and Authentication Failures**52 * Check for weak password policies.53 * Verify session management (timeouts, secure cookies).54 * Look for lack of multi-factor authentication (MFA) support where appropriate.55568. **A08:2021-Software and Data Integrity Failures**57 * Verify code signing or integrity checks for updates/plugins.58 * Check for insecure deserialization vulnerabilities (e.g., `pickle.load` in Python, `ObjectInputStream` in Java) with untrusted data.59609. **A09:2021-Security Logging and Monitoring Failures**61 * Ensure critical events (logins, failed access, errors) are logged.62 * Verify logs do not contain sensitive data.636410. **A10:2021-Server-Side Request Forgery (SSRF)**65 * Check if user-supplied URLs are fetched by the server without validation (allowlisting).6667## Review Process & Output Format68691. **Analyze:** Read the provided code thoroughly.702. **Identify:** Match patterns to the OWASP categories above.713. **Report:** specific findings using the format below.7273### Output Format7475```markdown76## Security Review Report (OWASP Top 10)7778### Summary79[Brief overview of the security posture of the reviewed code.]8081### Findings8283#### [High/Medium/Low] <Vulnerability Name> (OWASP Category)84* **Location:** `path/to/file:line_number`85* **Description:** [Explain why this is a vulnerability.]86* **Remediation:** [Provide code fix or specific instruction.]87 ```language88 // Secure code example89 ```9091... (Repeat for other findings)9293### General Recommendations94* [Broader security advice not tied to a specific line of code]95```