| name | security-validation |
| description | Comprehensive security validation for password generator applications. Use when auditing, implementing, or reviewing security measures for password handling and generation. |
| license | MIT |
Security Validation for Password Generators
When to Use
Use this skill for comprehensive security audits, implementing security measures, or reviewing code for security vulnerabilities in password generation applications.
Security Audit Process
1. Randomness Audit
Verify cryptographically secure random number generation:
- ✅ Use
crypto.getRandomValues() (Web) or crypto.randomBytes() (Node.js)
- ❌ Never use
Math.random() - it's predictable
2. Memory Security
- Clear passwords from memory after use
- Avoid storing in global/window scope
- Don't persist passwords to localStorage/sessionStorage
3. XSS Prevention
- Escape all user inputs before display
- Use textContent instead of innerHTML for password display
- Implement Content Security Policy
4. Dependency Audit
npm audit
npm audit fix
Security Checklist
See the security checklist for a complete validation list.
Automated Validation
grep -rn "Math.random" src/
grep -rn "console.log.*password" src/
grep -rn "innerHTML" src/
npm audit --audit-level=moderate
Reporting
Document any security findings with:
- Severity (Critical/High/Medium/Low)
- Location (file and line number)
- Description of vulnerability
- Recommended fix