Summary
The create_user method in JWTAuthManager accepts any password without complexity validation. Combined with the in-memory user store (no account lockout, no failed attempt tracking), this makes brute-force attacks more feasible.
Affected Files
truenas-mcp/src/auth.py (lines 496-524)
Impact
- Weak passwords could be easily guessed
- No protection against brute-force attacks
- No rate limiting to authentication endpoints
Recommended Fix
- Add password complexity validation (minimum length, character diversity)
- Implement account lockout after N failed attempts
- Add rate limiting to authentication endpoints
- Consider using an external identity provider for production
References
- CWE-521 (Weak Password Requirements)
- CWE-307 (Improper Restriction of Excessive Authentication Attempts)
🤖 Generated with Claude Code
Summary
The
create_usermethod inJWTAuthManageraccepts any password without complexity validation. Combined with the in-memory user store (no account lockout, no failed attempt tracking), this makes brute-force attacks more feasible.Affected Files
truenas-mcp/src/auth.py(lines 496-524)Impact
Recommended Fix
References
🤖 Generated with Claude Code