Scanning TOTP QR Code Can Crash the Bitwarden App #1226

Closed
opened 2025-11-26 22:42:26 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @sambartle on GitHub (Feb 27, 2021).

Describe the Bug

Scanning a QR Code in the android app to add a 2FA results in an approx 60% chance of success.
The other 40% of the time the app simply Force Closes (dissapears entirely)

This is NOT the same issue as https://github.com/bitwarden/mobile/issues/975 as in this case Bitwarden has FULL access to the camera permissions.

Steps To Reproduce

  1. Go to Bitwarden Mobile Application
  2. Edit any entry that does not have 2FA enabled
  3. Click the camera icon to scan the QR code, the preview appears.
  4. Point the camera at the QR Code.

Expected Result

QR Code scanned and the relevant data added.

Actual Result

Often the expected result occurs however in a LOT of cases.. the app simply scans the code and then crashes.
The entire android application is closed and returned to the previous application.

This is sometimes repeatable multiple times after opening and retrying.. sometimes it works sometimes it takes up to 4 attempts.

It doesn't appear to be related to the QR code.. the same one sometimes works first time, sometimes after 3 attempts.

Codes that scanned first time, if removed and re-added do not always scan first time next time.

Screenshots or Videos

I can create if needed as it happens often, but have not uploaded as the QR code would expose my live 2FA keys. (I can change one to get a fake key if needed)

Environment

  • Device: Google Pixel 3
  • Operating system: Android 11 RQ1A.210205.004
  • Build Version (go to "Settings" → "About" in the app): 2.8.0 (3349)
  • Is this a Beta release? No
Originally created by @sambartle on GitHub (Feb 27, 2021). ## Describe the Bug Scanning a QR Code in the android app to add a 2FA results in an approx 60% chance of success. The other 40% of the time the app simply Force Closes (dissapears entirely) This is NOT the same issue as https://github.com/bitwarden/mobile/issues/975 as in this case Bitwarden has FULL access to the camera permissions. ## Steps To Reproduce 1. Go to Bitwarden Mobile Application 2. Edit any entry that does not have 2FA enabled 3. Click the camera icon to scan the QR code, the preview appears. 4. Point the camera at the QR Code. ## Expected Result QR Code scanned and the relevant data added. ## Actual Result Often the expected result occurs however in a LOT of cases.. the app simply scans the code and then crashes. The entire android application is closed and returned to the previous application. This is sometimes repeatable multiple times after opening and retrying.. sometimes it works sometimes it takes up to 4 attempts. It doesn't appear to be related to the QR code.. the same one sometimes works first time, sometimes after 3 attempts. Codes that scanned first time, if removed and re-added do not always scan first time next time. ## Screenshots or Videos I can create if needed as it happens often, but have not uploaded as the QR code would expose my live 2FA keys. (I can change one to get a fake key if needed) ## Environment - Device: Google Pixel 3 - Operating system: Android 11 RQ1A.210205.004 - Build Version (go to "Settings" → "About" in the app): 2.8.0 (3349) - Is this a Beta release? No
Author
Owner

@lachlancooper commented on GitHub (Mar 2, 2021):

I'm seeing the same behaviour. I started using Bitwarden just over a week ago and was initially getting exactly one successful QR code scan each time I started the app, then the next one would crash. Following advice in #975 I granted camera and media permissions, which appeared to fix it.

Today I've been scanning more TOTP codes and getting roughly the same success rate as above, about 50% cause crashes. It's inconsistent; sometimes trying to scan the same code will fail multiple times in succession, but the next try will work.

My environment is exactly as above:

  • Device: Google Pixel 3
  • Operating system: Android 11 RQ1A.210205.004
  • Build Version (go to "Settings" → "About" in the app): 2.8.0 (3349)
  • Is this a Beta release? No
@lachlancooper commented on GitHub (Mar 2, 2021): I'm seeing the same behaviour. I started using Bitwarden just over a week ago and was initially getting exactly one successful QR code scan each time I started the app, then the next one would crash. Following advice in #975 I granted camera and media permissions, which _appeared_ to fix it. Today I've been scanning more TOTP codes and getting roughly the same success rate as above, about 50% cause crashes. It's inconsistent; sometimes trying to scan the same code will fail multiple times in succession, but the next try will work. My environment is exactly as above: - Device: Google Pixel 3 - Operating system: Android 11 RQ1A.210205.004 - Build Version (go to "Settings" → "About" in the app): 2.8.0 (3349) - Is this a Beta release? No
Author
Owner

@kendratodd commented on GitHub (Mar 11, 2021):

Hi @sambartle and @lachlancooper - this appears to be a duplicate of https://github.com/bitwarden/mobile/issues/1228. I'm going to consolidate your reports over there and close this ticket - thank you!

@kendratodd commented on GitHub (Mar 11, 2021): Hi @sambartle and @lachlancooper - this appears to be a duplicate of https://github.com/bitwarden/mobile/issues/1228. I'm going to consolidate your reports over there and close this ticket - thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#1226