Security Review
SentryOfficialPublished by Sentry
- Skill
- Review and audit
- Security
- CC-BY-SA-4.0
- Medium risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The Security Review skill provides a structured approach to auditing code for security vulnerabilities. It emphasizes deep research into data flow and context to distinguish between theoretical risks and truly exploitable issues. By focusing on attacker-controlled inputs and framework-specific mitigations, it reduces false positives and ensures that reported findings are actionable and high-confidence.
What it does
- Performs systematic security audits on provided code snippets or files.
- Traces data flow to confirm if inputs are attacker-controlled or server-controlled.
- Evaluates code against common vulnerability patterns like injection, XSS, and authentication flaws.
- Filters out false positives by checking for framework-level protections and sanitization.
- Categorizes findings by severity and confidence levels.
- Provides a standardized reporting format for identified vulnerabilities.
When to use it
- When you need to audit code for potential security vulnerabilities.
- When performing an OWASP-based security review.
- When you need to verify if a specific code pattern is exploitable.
- When checking for common security issues like SQL injection, XSS, or insecure authentication.
Advantages
- Reduces noise by filtering out theoretical issues and server-controlled configurations.
- Ensures high-confidence reporting by requiring codebase research before flagging.
- Provides clear, actionable remediation advice for identified vulnerabilities.
- Standardizes the security review process across different codebases.
Usage examples
- “Perform a security review on this file: [code snippet]”
- The agent will analyze the code, trace the data flow of inputs, and provide a report of any high-confidence vulnerabilities found, or state that none were identified.
- “Check this API endpoint for potential injection vulnerabilities.”
- The agent will examine the endpoint's input handling and database queries to determine if user input is properly parameterized or sanitized.
- “Audit this authentication logic for security issues.”
- The agent will review the authentication implementation against best practices, such as password storage algorithms and brute-force protections.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/getsentry/security-review/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip security-review.zip -d .agents/skills
Documentation by Sentry
<!-- Reference material based on OWASP Cheat Sheet Series (CC BY-SA 4.0) https://cheatsheetseries.owasp.org/ -->
Security Review Skill
Identify exploitable security vulnerabilities in code. Report only HIGH CONFIDENCE findings—clear vulnerable patterns with attacker-controlled input.
Scope: Research vs. Reporting
CRITICAL DISTINCTION:
Report on: Only the specific file, diff, or code provided by the user
Research: The ENTIRE codebase to build confidence before reporting
Before flagging any issue, you MUST research the codebase to understand:
Where does this input actually come from? (Trace data flow)
Is there validation/sanitization elsewhere?
How is this configured? (Check settings, config files, middleware)
What framework protections exist?
Do NOT report issues based solely on pattern matching. Investigate first, then report only what you're confident is exploitable.
Confidence Levels
| Level | Criteria | Action |
|---|---|---|
| HIGH | Vulnerable pattern + attacker-controlled input confirmed | Report with severity |
| MEDIUM | Vulnerable pattern, input source unclear | Note as "Needs verification" |
| LOW | Theoretical, best practice, defense-in-depth | Do not report |
Do Not Flag
General Rules
Test files (unless explicitly reviewing test security)
Dead code, commented code, documentation strings
Patterns using constants or server-controlled configuration
Code paths that require prior authentication to reach (note the auth requirement instead)
Server-Controlled Values (NOT Attacker-Controlled)
These are configured by operators, not controlled by attackers:
| Source | Example | Why It's Safe |
|---|---|---|
| Django settings | settings.API_URL, settings.ALLOWED_HOSTS | Set via config/env at deployment |
| Environment variables | os.environ.get('DATABASE_URL') | Deployment configuration |
| Config files | config.yaml, app.config['KEY'] | Server-side files |
| Framework constants | django.conf.settings.* | Not user-modifiable |
| Hardcoded values | BASE_URL = "https://api.internal" | Compile-time constants |
SSRF Example - NOT a vulnerability:
# SAFE: URL comes from Django settings (server-controlled)
response = requests.get(f"{settings.SEER_AUTOFIX_URL}{path}")SSRF Example - IS a vulnerability:
# VULNERABLE: URL comes from request (attacker-controlled)
response = requests.get(request.GET.get('url'))Framework-Mitigated Patterns
Check language guides before flagging. Common false positives:
| Pattern | Why It's Usually Safe |
|---|---|
Django {{ variable }} | Auto-escaped by default |
React {variable} | Auto-escaped by default |
Vue {{ variable }} | Auto-escaped by default |
User.objects.filter(id=input) | ORM parameterizes queries |
cursor.execute("...%s", (input,)) | Parameterized query |
innerHTML = "<b>Loading...</b>" | Constant string, no user input |
Only flag these when:
Django:
{{ var|safe }},{% autoescape off %},mark_safe(user_input)React:
dangerouslySetInnerHTML={{__html: userInput}}Vue:
v-html="userInput"ORM:
.raw(),.extra(),RawSQL()with string interpolation
Review Process
1. Detect Context
What type of code am I reviewing?
| Code Type | Load These References |
|---|---|
| API endpoints, routes | authorization.md, authentication.md, injection.md |
| Django/DRF views, permission classes, object-level access | Use the django-access-review skill if available for access control; otherwise authorization.md |
| Frontend, templates | xss.md, csrf.md, modern-threats.md (DOM clobbering, prototype pollution) |
| File handling, uploads | file-security.md |
| Crypto, secrets, tokens | cryptography.md, data-protection.md |
| Data serialization | deserialization.md |
| External requests | ssrf.md |
| Business workflows | business-logic.md |
| GraphQL, REST design | api-security.md |
| Config, headers, CORS | misconfiguration.md |
| CI/CD, dependencies | supply-chain.md |
| Error handling | error-handling.md |
| Audit, logging | logging.md |
Object merging/cloning, __proto__, DOM id/name lookups, WebSocket handlers, LLM prompt construction | modern-threats.md |
2. Load Language Guide
Based on file extension or imports:
| Indicators | Guide |
|---|---|
.py, django, flask, fastapi | languages/python.md |
.js, .ts, express, react, vue, next | languages/javascript.md |
For other languages there is no dedicated guide; rely on the references/ files and verify framework protections directly in the codebase.
3. Load Infrastructure Guide (if applicable)
| File Type | Guide |
|---|---|
Dockerfile, .dockerignore | infrastructure/docker.md |
| GitHub Actions workflows | Use the gha-security-review skill if available; otherwise references/supply-chain.md |
| Other CI/CD pipelines, lockfiles, package manifests | references/supply-chain.md |
4. Research Before Flagging
For each potential issue, research the codebase to build confidence:
Where does this value actually come from? Trace the data flow.
Is it configured at deployment (settings, env vars) or from user input?
Is there validation, sanitization, or allowlisting elsewhere?
What framework protections apply?
Only report issues where you have HIGH confidence after understanding the broader context.
5. Verify Exploitability
For each potential finding, confirm:
Is the input attacker-controlled?
| Attacker-Controlled (Investigate) | Server-Controlled (Usually Safe) |
|---|---|
request.GET, request.POST, request.args | settings.X, app.config['X'] |
request.json, request.data, request.body | os.environ.get('X') |
request.headers (most headers) | Hardcoded constants |
request.cookies (unsigned) | Internal service URLs from config |
URL path segments: /users/<id>/ | Database content from admin/system |
| File uploads (content and names) | Signed session data |
| Database content from other users | Framework settings |
| WebSocket messages |
Does the framework mitigate this?
Check language guide for auto-escaping, parameterization
Check for middleware/decorators that sanitize
Is there validation upstream?
Input validation before this code
Sanitization libraries (DOMPurify, bleach, etc.)
6. Report HIGH Confidence Only
Skip theoretical issues. Report only what you've confirmed is exploitable after research.
Severity Classification
| Severity | Impact | Examples |
|---|---|---|
| Critical | Direct exploit, severe impact, no auth required | RCE, SQL injection to data, auth bypass, hardcoded secrets |
| High | Exploitable with conditions, significant impact | Stored XSS, SSRF to metadata, IDOR to sensitive data |
| Medium | Specific conditions required, moderate impact | Reflected XSS, CSRF on state-changing actions, path traversal |
| Low | Defense-in-depth, minimal direct impact | Missing headers, verbose errors, weak algorithms in non-critical context |
Quick Patterns Reference
Always Flag (Critical)
eval(user_input) # Any language
exec(user_input) # Any language
pickle.loads(user_data) # Python
yaml.load(user_data) # Python (not safe_load)
unserialize($user_data) # PHP
deserialize(user_data) # Java ObjectInputStream
shell=True + user_input # Python subprocess
child_process.exec(user) # Node.jsAlways Flag (High)
innerHTML = userInput # DOM XSS
dangerouslySetInnerHTML={user} # React XSS
v-html="userInput" # Vue XSS
f"SELECT * FROM x WHERE {user}" # SQL injection
`SELECT * FROM x WHERE ${user}` # SQL injection
os.system(f"cmd {user_input}") # Command injectionAlways Flag (Secrets)
password = "hardcoded"
api_key = "sk-..."
AWS_SECRET_ACCESS_KEY = "..."
private_key = "-----BEGIN"Check Context First (MUST Investigate Before Flagging)
# SSRF - ONLY if URL is from user input, NOT from settings/config
requests.get(request.GET['url']) # FLAG: User-controlled URL
requests.get(settings.API_URL) # SAFE: Server-controlled config
requests.get(f"{settings.BASE}/{x}") # CHECK: Is 'x' user input?
# Path traversal - ONLY if path is from user input
open(request.GET['file']) # FLAG: User-controlled path
open(settings.LOG_PATH) # SAFE: Server-controlled config
open(f"{BASE_DIR}/{filename}") # CHECK: Is 'filename' user input?
# Open redirect - ONLY if URL is from user input
redirect(request.GET['next']) # FLAG: User-controlled redirect
redirect(settings.LOGIN_URL) # SAFE: Server-controlled config
# Weak crypto - ONLY if used for security purposes
hashlib.md5(file_content) # SAFE: File checksums, caching
hashlib.md5(password) # FLAG: Password hashing
random.random() # SAFE: Non-security uses (UI, sampling)
random.random() for token # FLAG: Security tokens need secrets moduleOutput Format
## Security Review: [File/Component Name]
### Summary
- **Findings**: X (Y Critical, Z High, ...)
- **Risk Level**: Critical/High/Medium/Low
- **Confidence**: High/Mixed
### Findings
#### [VULN-001] [Vulnerability Type] (Severity)
- **Location**: `file.py:123`
- **Confidence**: High
- **Issue**: [What the vulnerability is]
- **Impact**: [What an attacker could do]
- **Evidence**:
```python
[Vulnerable code snippet]Fix: [How to remediate]
Needs Verification
[VERIFY-001] [Potential Issue]
Location:
file.py:456Question: [What needs to be verified]
If no vulnerabilities found, state: "No high-confidence vulnerabilities identified."
---
## Reference Files
### Core Vulnerabilities (`references/`)
| File | Covers |
|------|--------|
| `injection.md` | SQL, NoSQL, OS command, LDAP, template injection |
| `xss.md` | Reflected, stored, DOM-based XSS |
| `authorization.md` | Authorization, IDOR, privilege escalation |
| `authentication.md` | Sessions, credentials, password storage |
| `cryptography.md` | Algorithms, key management, randomness |
| `deserialization.md` | Pickle, YAML, Java, PHP deserialization |
| `file-security.md` | Path traversal, uploads, XXE |
| `ssrf.md` | Server-side request forgery |
| `csrf.md` | Cross-site request forgery |
| `data-protection.md` | Secrets exposure, PII, logging |
| `api-security.md` | REST, GraphQL, mass assignment |
| `business-logic.md` | Race conditions, workflow bypass |
| `modern-threats.md` | Prototype pollution, LLM injection, WebSocket |
| `misconfiguration.md` | Headers, CORS, debug mode, defaults |
| `error-handling.md` | Fail-open, information disclosure |
| `supply-chain.md` | Dependencies, build security |
| `logging.md` | Audit failures, log injection |
### Language Guides (`languages/`)
- `python.md` - Django, Flask, FastAPI patterns
- `javascript.md` - Node, Express, React, Vue, Next.js
### Infrastructure (`infrastructure/`)
- `docker.md` - Container securityFiles
- ATTRIBUTION.mdAdded by AutoGineer902 B
- LICENSE884 B
- SKILL.md11.5 KiB
- SPEC.md8.8 KiB
- infrastructure/docker.md9.2 KiB
- languages/javascript.md9.8 KiB
- languages/python.md9.3 KiB
- references/api-security.md12.4 KiB
- references/authentication.md8.9 KiB
- references/authorization.md9.8 KiB
- references/business-logic.md12.4 KiB
- references/cryptography.md8.5 KiB
- references/csrf.md9.7 KiB
- references/data-protection.md9.3 KiB
- references/deserialization.md10.0 KiB
- references/error-handling.md11.4 KiB
- references/file-security.md12.1 KiB
- references/injection.md6.7 KiB
- references/logging.md11.7 KiB
- references/misconfiguration.md10.1 KiB
- references/modern-threats.md13.0 KiB
- references/ssrf.md10.5 KiB
- references/supply-chain.md8.9 KiB
- references/xss.md7.4 KiB
references/misconfiguration.md
Security Misconfiguration Reference
Overview
Security misconfiguration is one of the most common vulnerabilities. It occurs when security settings are not defined, implemented incorrectly, or left at insecure defaults. This includes missing security headers, overly permissive CORS, debug mode in production, and exposed sensitive endpoints.
Security Headers
Missing Headers
# VULNERABLE: No security headers
@app.route('/')
def index():
return render_template('index.html')
# SAFE: Security headers configured
@app.after_request
def add_security_headers(response):
response.headers['X-Content-Type-Options'] = 'nosniff'
response.headers['X-Frame-Options'] = 'DENY'
response.headers['X-XSS-Protection'] = '1; mode=block'
response.headers['Strict-Transport-Security'] = 'max-age=31536000; includeSubDomains'
response.headers['Content-Security-Policy'] = "default-src 'self'"
response.headers['Referrer-Policy'] = 'strict-origin-when-cross-origin'
response.headers['Permissions-Policy'] = 'geolocation=(), microphone=()'
return responseHeader Checklist
| Header | Purpose | Secure Value |
|---|---|---|
X-Content-Type-Options | Prevent MIME sniffing | nosniff |
X-Frame-Options | Prevent clickjacking | DENY or SAMEORIGIN |
Strict-Transport-Security | Force HTTPS | max-age=31536000; includeSubDomains |
Content-Security-Policy | Prevent XSS, injection | Restrictive policy |
Referrer-Policy | Control referrer leakage | strict-origin-when-cross-origin |
Permissions-Policy | Disable browser features | Disable unused features |
Content Security Policy
# VULNERABLE: Overly permissive CSP
"Content-Security-Policy: default-src *"
"Content-Security-Policy: script-src 'unsafe-inline' 'unsafe-eval'"
# SAFE: Restrictive CSP
"Content-Security-Policy: default-src 'self'; script-src 'self' 'nonce-{random}'; style-src 'self'; img-src 'self' data:; font-src 'self'; connect-src 'self'; frame-ancestors 'none'"CORS Misconfiguration
Dangerous Patterns
# VULNERABLE: Allow all origins
CORS(app, origins='*')
Access-Control-Allow-Origin: *
# VULNERABLE: Reflect origin without validation
@app.after_request
def add_cors(response):
response.headers['Access-Control-Allow-Origin'] = request.headers.get('Origin')
response.headers['Access-Control-Allow-Credentials'] = 'true'
return response
# VULNERABLE: Wildcard with credentials (browsers block, but shows misconfiguration)
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
# VULNERABLE: Null origin allowed
Access-Control-Allow-Origin: nullSafe CORS Configuration
# SAFE: Explicit allowlist
ALLOWED_ORIGINS = {
'https://app.example.com',
'https://admin.example.com'
}
@app.after_request
def add_cors(response):
origin = request.headers.get('Origin')
if origin in ALLOWED_ORIGINS:
response.headers['Access-Control-Allow-Origin'] = origin
response.headers['Access-Control-Allow-Credentials'] = 'true'
response.headers['Access-Control-Allow-Methods'] = 'GET, POST, OPTIONS'
response.headers['Access-Control-Allow-Headers'] = 'Content-Type, Authorization'
return responseDebug Mode in Production
Dangerous Patterns
# VULNERABLE: Debug mode enabled
# Flask
app.run(debug=True)
DEBUG = True
# Django
DEBUG = True # in settings.py
# Express
app.set('env', 'development')
# Spring Boot
spring.devtools.restart.enabled=true
management.endpoints.web.exposure.include=*Detection
# Check for debug indicators
if app.debug:
# Exposes stack traces, allows code execution in some frameworks
pass
# Check environment variables
if os.environ.get('DEBUG') == 'true':
pass
if os.environ.get('FLASK_ENV') == 'development':
passDefault Credentials
Patterns to Flag
# VULNERABLE: Default/weak credentials
username = 'admin'
password = 'admin'
password = 'password'
password = '123456'
password = 'changeme'
password = 'default'
# VULNERABLE: Well-known default credentials
# Database defaults
DB_PASSWORD = 'root'
DB_PASSWORD = 'postgres'
DB_PASSWORD = 'mysql'
# Admin panel defaults
ADMIN_PASSWORD = 'admin123'
SECRET_KEY = 'development-secret-key'Configuration Files to Check
# Docker Compose
services:
db:
environment:
MYSQL_ROOT_PASSWORD: root # VULNERABLE
POSTGRES_PASSWORD: postgres # VULNERABLE
# Kubernetes Secrets (base64 encoded defaults)
apiVersion: v1
kind: Secret
data:
password: YWRtaW4= # 'admin' base64 encoded - VULNERABLEExposed Endpoints
Admin/Debug Endpoints
# VULNERABLE: Exposed debug endpoints
@app.route('/debug')
@app.route('/admin') # without authentication
@app.route('/metrics') # without authentication
@app.route('/health') # may expose sensitive info
@app.route('/env')
@app.route('/config')
@app.route('/phpinfo.php')
@app.route('/.git')
@app.route('/.env')
# Spring Boot Actuator endpoints
/actuator/env
/actuator/heapdump
/actuator/configprops
/actuator/mappingsProtection
# SAFE: Protect sensitive endpoints
@app.route('/admin')
@require_admin
def admin_panel():
pass
@app.route('/metrics')
@require_internal_network
def metrics():
pass
# Spring Boot: Restrict actuator
management.endpoints.web.exposure.include=health,info
management.endpoint.health.show-details=neverTLS/SSL Misconfiguration
Insecure Patterns
# VULNERABLE: SSL verification disabled
requests.get(url, verify=False)
urllib3.disable_warnings()
# VULNERABLE: Weak TLS versions
ssl_context.minimum_version = ssl.TLSVersion.TLSv1 # Use TLS 1.2+
# VULNERABLE: Weak cipher suites
ssl_context.set_ciphers('ALL')
ssl_context.set_ciphers('DEFAULT')Secure Configuration
# SAFE: Proper TLS configuration
import ssl
context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
context.minimum_version = ssl.TLSVersion.TLSv1_2
context.set_ciphers('ECDHE+AESGCM:DHE+AESGCM:ECDHE+CHACHA20')
context.verify_mode = ssl.CERT_REQUIRED
context.check_hostname = TrueDirectory Listing
Dangerous Patterns
# VULNERABLE: Directory listing enabled
# Nginx
autoindex on;
# Apache
Options +Indexes
# Python
python -m http.server # Lists directories by defaultSecure Configuration
# SAFE: Directory listing disabled
# Nginx
autoindex off;
# Apache
Options -IndexesVerbose Error Messages
Dangerous Patterns
# VULNERABLE: Detailed errors in response
@app.errorhandler(Exception)
def handle_error(e):
return jsonify({
'error': str(e),
'traceback': traceback.format_exc(),
'query': last_executed_query,
'config': app.config
}), 500
# VULNERABLE: Stack traces exposed
app.config['PROPAGATE_EXCEPTIONS'] = TrueSecure Error Handling
# SAFE: Generic error messages
@app.errorhandler(Exception)
def handle_error(e):
app.logger.error(f"Error: {e}", exc_info=True) # Log details server-side
return jsonify({'error': 'An unexpected error occurred'}), 500Cookie Security
Insecure Patterns
# VULNERABLE: Insecure cookie settings
response.set_cookie('session', value) # Missing flags
# VULNERABLE: Explicit insecure flags
response.set_cookie('session', value, secure=False, httponly=False, samesite='None')Secure Cookie Configuration
# SAFE: Secure cookie settings
response.set_cookie(
'session',
value,
secure=True, # HTTPS only
httponly=True, # No JavaScript access
samesite='Lax', # CSRF protection
max_age=3600, # Reasonable expiration
path='/',
domain='.example.com'
)
# Flask session configuration
app.config['SESSION_COOKIE_SECURE'] = True
app.config['SESSION_COOKIE_HTTPONLY'] = True
app.config['SESSION_COOKIE_SAMESITE'] = 'Lax'Permissive File Permissions
Dangerous Patterns
# VULNERABLE: World-readable sensitive files
os.chmod(config_file, 0o777)
os.chmod(private_key, 0o644)
# VULNERABLE: Overly permissive umask
os.umask(0o000)Secure Permissions
# SAFE: Restrictive permissions
os.chmod(config_file, 0o600) # Owner read/write only
os.chmod(private_key, 0o400) # Owner read only
os.chmod(script, 0o700) # Owner execute onlyHTTP Methods
Dangerous Patterns
# VULNERABLE: All methods allowed
@app.route('/api/data', methods=['GET', 'POST', 'PUT', 'DELETE', 'TRACE', 'OPTIONS'])
# VULNERABLE: TRACE method enabled (XST attacks)
# VULNERABLE: Unnecessary methods on sensitive endpointsSecure Configuration
# SAFE: Explicit method restrictions
@app.route('/api/data', methods=['GET'])
def get_data():
pass
@app.route('/api/data', methods=['POST'])
@require_auth
def create_data():
passGrep Patterns for Detection
# Debug mode
grep -rn "debug.*=.*[Tt]rue\|DEBUG.*=.*[Tt]rue" --include="*.py" --include="*.js" --include="*.json"
# CORS wildcards
grep -rn "Access-Control-Allow-Origin.*\*\|origins.*\*\|origin.*\*" --include="*.py" --include="*.js"
# SSL verification disabled
grep -rn "verify.*=.*[Ff]alse\|rejectUnauthorized.*false\|NODE_TLS_REJECT_UNAUTHORIZED" --include="*.py" --include="*.js"
# Default credentials
grep -rn "password.*=.*['\"]admin\|password.*=.*['\"]root\|password.*=.*['\"]123456" --include="*.py" --include="*.yaml" --include="*.yml"
# Missing security headers (check for absence)
grep -rn "after_request\|middleware" --include="*.py" | grep -v "X-Content-Type-Options\|X-Frame-Options"
# Exposed endpoints
grep -rn "@app.route.*debug\|@app.route.*admin\|@app.route.*config\|/actuator" --include="*.py" --include="*.java"References
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Declares allowed tools, Needs an API key, Needs Python
Security
What our scanner noticed· Medium risk
- References to credential files
- Instructions that use the network
- Encoded commands that are executed
- Downloads piped into a shell
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Sentry
- Publisher
- Sentry (Official)
- Source
- getsentry/skills · skills/security-review · commit e94f222
- Licence
- Creative Commons Attribution-ShareAlike 4.0 International (redistribution allowed)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Sentry or Sentry.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download security-review.zip