security-lens
Apply security awareness during code review and implementation. Catches common vulnerabilities without requiring full security audit.
When & Why to Use This Skill
The Security Awareness Lens is a specialized Claude skill designed to integrate proactive security auditing into the software development lifecycle. It acts as an automated security reviewer that identifies critical vulnerabilities—such as SQL injection, Cross-Site Scripting (XSS), and sensitive data exposure—during the code implementation phase. By focusing on OWASP-aligned patterns, it empowers developers to maintain high security standards and catch common flaws without requiring a full-scale manual security audit.
Use Cases
- Automated Pull Request Reviews: Automatically scan incoming code changes for security anti-patterns like hardcoded secrets, unvalidated inputs, or insecure file path handling.
- Secure Database Integration: Ensure all database interactions use parameterized queries instead of string concatenation to prevent SQL injection attacks.
- Data Leakage Prevention: Review logging statements and API response structures to ensure that PII, session tokens, or internal system details are not accidentally exposed.
- Authentication & Authorization Validation: Verify that sensitive operations include server-side permission checks and that session cookies are configured with secure attributes like httpOnly and SameSite.
- Input Sanitization Checks: Audit web-facing code to ensure that HTML output is properly escaped and user-provided data is validated before processing to mitigate XSS and path traversal risks.
| name | security-lens |
|---|---|
| description | Apply security awareness during code review and implementation. Catches common vulnerabilities without requiring full security audit. |
Security Awareness Lens
When reviewing or writing code, check for:
Input Handling
- User input validated before use
- SQL uses parameterized queries (never string concat)
- HTML output escaped to prevent XSS
- File paths validated (no path traversal)
Authentication/Authorization
- Auth checks at controller level, not just UI
- Sensitive operations re-verify permissions
- Session tokens are httpOnly, secure, sameSite
Data Exposure
- Logs don't contain secrets, tokens, PII
- Error messages don't leak internal details
- API responses don't include unnecessary fields
Secrets
- No hardcoded credentials
- Secrets from environment/vault, not config files
- .gitignore covers .env, credentials
See @owasp-quick-ref.md for detailed vulnerability patterns.