KDF form doesn't load current KDF iterations value when toggling algorithm
- Dominant language
- TypeScript
- Stars
- 13.8k
- Forks
- 2k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 397
Description
### Steps To Reproduce
1. Have KDF algorithm set to PBKDF2 with a nondefault value of KDF iterations.
2. Log in to web vault, and go to _Encryption Key Settings_ page.
3. Observe the value shown in the **KDF iterations** field.
4. Change the **KDF algorithm** dropdown value from `PBKDF2 SHA-256` to `Argon2id`.
5. Change the **KDF algorithm** dropdown value from `Argon2id` back to `PBKDF2 SHA-256`.
6. Observe the value shown in the KDF iterations field.
### Expected Result
The number of KDF iterations observed in **Step 6** should match the number of KDF iterations observed in **Step 2**.
### Actual Result
The number of KDF iterations observed in **Step 6** does not match the number of KDF iterations observed in **Step 2**. In **Step 6**, the value shown is `600000` (i.e., the default value for new accounts) instead of the current KDF iterations value (which was never changed in the procedure above).
### Screenshots or Videos
_No response_
### Additional Context
This is just an issue with how the form field values are loaded. The actual number of KDF iterations has not been modified by the process described above (this can be verified by clicking the _Master Password_ tab and then returning to the _Keys_ tab, which will load the currently stored value of the KDF iterations).
I have not checked whether the same issue occurs if one is using Argon2id with nondefault settings, then visits the _Encryption Key Settings_ form and toggles the KDF algorithm to PBKDF2 and back to Argon2id.
### Operating System
Windows
### Operating System Version
10 (20H2)
### Web Browser
Chrome
### Browser Version
111.0.5563.64
### Build Version
2023.2.0
### Issue Tracking Info
- [X] I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.
Contributor guide
Research direction
Open the web vault's Encryption Key Settings page and reproduce the PBKDF2-to-Argon2id-to-PBKDF2 toggle described in the issue. Compare the displayed KDF iterations value before and after toggling, and verify that it remains the currently stored value rather than reverting to 600000.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100