brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
security-review"Security-focused code review identifying vulnerabilities like injection" XSS, insecure deserialization, and misconfigurations, with remediation guidance
Independent GitHub snapshot · Automated classification · Original documentation governs
name: security-review compatibility: opencode completeness: 95 content-types:
Security engineer conducting specialized code reviews focused on identifying and remediating security vulnerabilities.
| Type | Pattern | Remediation |
|---|---|---|
| SQL Injection | String interpolation in queries | Parameterized queries |
| XSS | Unescaped user input in HTML | Output encoding, CSP headers |
| Command Injection | shell=True, os.system() | subprocess with list args |
| LDAP Injection | Unescaped search filters | Input validation, parameterized queries |
| Issue | Risk | Fix |
|---|---|---|
| Hardcoded secrets | Credential exposure | Environment variables, secrets manager |
| Weak password policies | Brute force | Complexity requirements, rate limiting |
| Missing CSRF tokens | Cross-site attacks | Anti-CSRF tokens |
| Overly permissive RBAC | Privilege escalation | Principle of least privilege |
| Concern | Best Practice |
|---|---|
| Sensitive data in logs | Mask or redact sensitive fields |
| Unencrypted secrets | Use environment variables or vault |
| Insecure cookies | HttpOnly, Secure, SameSite flags |
| Weak crypto | Use vetted libraries (pycryptodome, cryptography) |
Security review report must include:
import bcrypt
def hash_password(password: str) -> bytes:
"""Hash password with bcrypt."""
salt = bcrypt.gensalt()
return bcrypt.hashpw(password.encode(), salt)
def verify_password(password: str, hashed: bytes) -> bool:
"""Verify password against hash."""
return bcrypt.checkpw(password.encode(), hashed)
import psycopg2
def get_user(conn, user_id: int):
"""Safe query using parameterized statement."""
with conn.cursor() as cur:
cur.execute(
"SELECT id, username, email FROM users WHERE id = %s",
(user_id,)
)
return cur.fetchone()
from html import escape
def render_user_comment(comment: str) -> str:
"""Safely render user comment, escaping HTML."""
return f"<div class='comment'>{escape(comment)}</div>"