Skip to content

fix: Enforce password complexity requirements on admin setup (#189) - #198

Merged
vybe merged 3 commits into
Abilityai:mainfrom
AndriiPasternak31:feature/189-password-complexity
Apr 1, 2026
Merged

vybe merged 3 commits into
Abilityai:mainfrom
AndriiPasternak31:feature/189-password-complexity

Conversation

@AndriiPasternak31

Copy link
Copy Markdown
Contributor

Description

Add OWASP ASVS 2.1 password complexity validation to the admin setup endpoint. Passwords now require 12+ characters, uppercase, lowercase, digit, special character, and must not be a common password. The frontend shows a real-time requirements checklist, and the backend returns a generic error message on the unauthenticated endpoint to avoid leaking which specific rules failed.

Related Issue

Fixes #189

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Testing

  • I have tested this locally
  • New tests added (if applicable)
  • All existing tests pass

Checklist

  • My code follows the project's style guidelines
  • I have updated the documentation (if applicable)
  • I have not committed any sensitive data (API keys, credentials, etc.)
  • I have added appropriate logging for new functionality

AndriiPasternak31 and others added 3 commits March 26, 2026 23:57
…ai#189)

Add OWASP ASVS 2.1 password complexity validation to the admin setup
endpoint. Passwords now require 12+ chars, uppercase, lowercase, digit,
special character, and must not be a common password.

- New: src/backend/utils/password_validation.py with reusable validator
- New: tests/test_password_validation.py with 25 unit tests
- Setup endpoint returns generic error (doesn't leak which rules failed)
- Pydantic model adds max_length=128 (bcrypt DoS protection)
- database.py logs specific failing rules for weak ADMIN_PASSWORD env var
- Frontend shows real-time requirements checklist

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Update feature flow and index to reflect OWASP ASVS 2.1 password
validation added in Abilityai#189.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Resolved 5 conflicts by merging both the setup_token security feature
(upstream) and OWASP password complexity validation (this branch):
- setup.py: Added setup_token validation before password complexity check
- SetupPassword.vue: isValid requires both setup_token AND all password rules
- test_setup.py: Kept upstream's token rejection test with compliant password
- changelog.md & feature-flows.md: Combined entries from both branches

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@vybe

vybe commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

PR approved — please rebase on main to resolve the merge conflict, then we'll merge. Two PRs landed on main since your branch was last synced.

@vybe
vybe merged commit c379021 into Abilityai:main Apr 1, 2026
@AndriiPasternak31
AndriiPasternak31 deleted the feature/189-password-complexity branch April 25, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SEC: Weak Password Policy — no complexity requirements

2 participants