Security & Architecture Rules Catalog
SQL Injection Vulnerability
Dynamic SQL query built with unescaped string concatenation or formatting allows arbitrary query execution.
Cross-Site Scripting (XSS)
Unsanitized user-controlled input rendered directly into the DOM or HTML response allows script injection.
Hardcoded Secret / Credential Leak
High-entropy credential, API token, private key, or password found hardcoded in source files.
Command Injection Vulnerability
Operating system command executed using dynamic string concatenation with untrusted input.
Server-Side Request Forgery (SSRF)
Server makes an outbound HTTP request using a user-supplied target address without strict whitelist validation.
Path Traversal Vulnerability
File system operations performed using unsanitized user-provided file paths containing directory traversal characters.
Use of Broken or Weak Cryptographic Algorithm
Cryptographic operations using broken algorithms like MD5, SHA-1, DES, or predictable pseudo-random number generators.
Unsafe Object Deserialization
Deserializing untrusted data with unrestricted object instantiation mechanisms like Python pickle, Java ObjectInputStream, or PHP unserialize.
God Class Anti-Pattern
Class exceeds excessive line count (>500 LOC) and handles too many distinct responsibilities.
Excessive Method Length
Method or function exceeds recommended maximum length (>60 lines).
Deep Control Flow Nesting
Block nesting depth exceeds 4 levels of nested if/for/while statements.
Unreachable or Dead Code Detected
Code blocks following return/throw statements or unused private functions that can never be executed.
N+1 Database Query Pattern in Loop
Database query executed inside a loop over a collection of records.
Blocking Synchronous I/O in Async Context
Synchronous file/network operations (e.g. `fs.readFileSync`, `time.sleep`) executed on an async event loop.
Circular Module Dependency
Modules import each other directly or transitively in a closed dependency loop.
Container Runs as Root User
Dockerfile does not specify a non-root USER directive.
Kubernetes Pod Configured in Privileged Mode
Container securityContext has `privileged: true`.