fix(security): Consistent 128‑char password handling and hardened auth validation#3149
fix(security): Consistent 128‑char password handling and hardened auth validation#3149
Conversation
- Resolved duplicate maxLength property in password_update_page.dart - Updated validation mode from eager to passive in creation_password_fields.dart - Added onChanged callback for password validity notification - Removed duplicate imports in both files - Maintained consistent password field behavior across the application
…ants\n\n- Define passwordMaxLength=128 for UI inputs\n- Add lastLoggedInWalletKey for quick login feature\n- Update matrixIdRegex for stricter validation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Codex Review: Here are some suggestions.
Reply with @codex fix comments to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
There was a problem hiding this comment.
Pull Request Overview
This PR enforces a global 128-character password length limit across all password input dialogs and standardizes validation behavior to improve consistency and user experience.
- Refactored password input validation to rely on Form autovalidation instead of custom state management
- Added password length enforcement using
passwordMaxLengthconstant across login, creation, deletion, and change dialogs - Implemented callback-driven validation state to enable/disable Create button only when both password fields are valid
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
packages/komodo_ui_kit/lib/src/inputs/ui_text_form_field.dart |
Simplified validation logic by removing custom error state management and relying on Form autovalidation |
lib/views/wallets_manager/widgets/wallet_login.dart |
Added constants import and applied consistent password field formatting |
lib/views/wallets_manager/widgets/wallet_deleting.dart |
Removed duplicate import, reordered password field properties, applied code formatting |
lib/views/wallets_manager/widgets/wallet_creation.dart |
Added password validity tracking and callback to enable Create button only when passwords are valid |
lib/views/wallets_manager/widgets/creation_password_fields.dart |
Implemented validity callback system and switched to passive validation mode |
lib/views/settings/widgets/security_settings/password_update_page.dart |
Moved constants import to proper location |
lib/views/common/wallet_password_dialog/password_dialog_content.dart |
Added constants import for password length enforcement |
lib/views/common/hw_wallet_dialog/trezor_steps/trezor_dialog_select_wallet.dart |
Added constants import, has duplicate import issue |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
lib/views/common/hw_wallet_dialog/trezor_steps/trezor_dialog_select_wallet.dart
Outdated
Show resolved
Hide resolved
|
@cursor please review |
|
I streamlined the codebase by removing redundant
3 tasks completed
Learn more about Cursor Agents |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Visit the preview URL for this PR (updated for commit 69b25c1): https://walletrc--pull-3149-merge-d1fi9903.web.app (expires Thu, 25 Sep 2025 15:39:23 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc |
smk762
left a comment
There was a problem hiding this comment.
- 128 char input limit confirmed (#3151 outstanding).
- < 8 char constraint honored with disabled button and error message
- lowercase char requirement honored with disabled button and error message
- uppercase char requirement honored with disabled button and error message
- numeric char requirement honored with disabled button and error message
- special char requirement honored with disabled button and error message
- matching value in confirmation input honored with disabled button and error message.
|
Overall it is good. At least the user cannot bypass password confirmation. But there is a small UI issue with error messages. For example, enter video_2025-09-17_21-32-15.mp4 |
There was a problem hiding this comment.
Bug: Validation Error Display Issue
When a UiTextFormField loses focus in eager or passive validation modes, _shouldValidate updates directly without a setState() call. This prevents the TextFormField's autovalidateMode from updating, so validation errors don't appear immediately after focus loss.
Description
Security/auth hardening
passwordMaxLength = 128across all auth/password flows by switching fromLengthLimitingTextInputFormatter(40)tomaxLengthwith hidden counters:wallet_login.dart,password_dialog_content.dart,password_update_page.dart,wallet_deleting.dart,wallet_import_by_file.dart,trezor_dialog_select_wallet.dartCreationPasswordFieldsnow uses passive validation and exposesonValidityChangedwallet_creation.dartdisables the Create button until both fields are validUI/UX and shared components
UiTextFormField: simplified validation behavior; usesAutovalidateModeperInputValidationMode; surfaces externalerrorTextdirectlygrouped_asset_ticker_item.dartcoin_select_item_widget.dartManual QA checklist