Repository navigation
[PM-33393] fix: TOTP auth key can be shown by users without permission [bug-factory poc] - #7487
Conversation
β¦it itemsβ¦ [bug-factory poc] Automated fix from the AI-49 bug factory. Proof: ./gradlew :app:testStandardDebugUnitTest --tests "*VaultAddEditScreenTest.in ItemType_Login state the TOTP text field should be visible but disabled*" must fail on base and pass with the fix.
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7487 +/- ##
=======================================
Coverage 86.80% 86.80%
=======================================
Files 895 895
Lines 65676 65684 +8
Branches 9384 9385 +1
=======================================
+ Hits 57007 57015 +8
Misses 5189 5189
Partials 3480 3480
Flags with carried forward coverage won't be shown. Click here to find out more. β View full report in Codecov by Harness. π New features to boost your workflow:
|
π€ Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR fixes the TOTP key leak on the add/edit screen. When a user cannot view passwords and the item already has a key, |
There was a problem hiding this comment.
π΅ Needs a closer look
This security-sensitive permission fix requires the owning-team review explicitly requested before merge.
0 open findings
What changed in this PR
Prevents users without TOTP viewing permission from revealing an existing authenticator key on the Edit login screen.
Changes:
- Displays existing restricted keys in a disabled, masked field.
- Updates regression coverage to check masking and absence of reveal, copy, delete, and setup controls.
| File | Description |
|---|---|
| app/βsrc/βtest/βkotlin/βcom/βx8bit/βbitwarden/βui/βvault/βfeature/βaddedit/βVaultAddEditScreenTest.kt | Verifies restricted authenticator-key display and controls. |
| app/βsrc/βmain/βkotlin/βcom/βx8bit/βbitwarden/βui/βvault/βfeature/βaddedit/βVaultAddEditLoginItems.kt | Uses a hidden field when key viewing is disallowed. |
π§ Review effort: Balanced
π‘ Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| cardStyle = CardStyle.Full, | ||
| modifier = modifier | ||
| .fillMaxWidth() | ||
| .focusProperties { canFocus = false }, |
There was a problem hiding this comment.
Why is this needed?
Wouldn't this be an accessibility issue?
There was a problem hiding this comment.
It does not impair the accessibility features but it is also not necessary π
|
@david-livefront Thank you! π |
branch: PM-33393-totp-key-hidden-passwords
base: main
ποΈ Tracking
https://bitwarden.atlassian.net/browse/PM-33393
π Objective
Automated fix produced by the bug factory (AI-49 proof of concept). Needs review from the owning team before merge.
verified: genuine, live, unduplicated. On "Edit login", a member with "Edit items, hidden passwords" taps Show and sees the raw authenticator key
JBSWY3DPEHPK3PXP. I re-observed this on the device. The same code shipped inv2026.9.1-bwpm.πΈ Screenshots
The bug was reproduced on an emulator before the fix. The fix itself is proven by a JVM unit test.
π§ͺ Proof
./gradlew :app:testStandardDebugUnitTest --tests "*VaultAddEditScreenTest.in ItemType_Login state the TOTP text field should be visible but disabled*"on the base code (must fail) exited 1; with the fix (must pass) exited 0.Base run
Fix run
π€ Automated review
β° Reminders before merge