bitwarden / mobile

Retired Bitwarden mobile app for iOS and Android (MAUI/Xamarin).
https://bitwarden.com
GNU General Public License v3.0
61 stars 8 forks source link

Android App Crashes when User Logs In #1125

Closed UBvZqPIswlD2VNyaR0rlQFNyxI0l5hZToMdvTHt closed 2 years ago

UBvZqPIswlD2VNyaR0rlQFNyxI0l5hZToMdvTHt commented 3 years ago

Hi, Device: Xiaomi Mi A3 Android 10 (all updates installed) Version 2.6.1

When I try to click on Log In or use the Button on the Keyboard i see following in logcat:

2020-10-20 18:58:36.920 32433-32433/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.x8bit.bitwarden, PID: 32433
    android.runtime.JavaProxyThrowable: System.InvalidOperationException: The character set provided in ContentType is invalid. Cannot read content as string using an invalid character set. ---> System.ArgumentException: '"UTF-8"' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
    Parameter name: name
      at System.Globalization.EncodingTable.internalGetCodePageFromName (System.String name) [0x00097] in <8f1a893b5ab6478299d5fb8196347666>:0 
      at System.Globalization.EncodingTable.GetCodePageFromName (System.String name) [0x00036] in <8f1a893b5ab6478299d5fb8196347666>:0 
      at System.Text.Encoding.GetEncoding (System.String name) [0x0000c] in <8f1a893b5ab6478299d5fb8196347666>:0 
      at System.Net.Http.HttpContent.ReadBufferAsString (System.ArraySegment`1[T] buffer, System.Net.Http.Headers.HttpContentHeaders headers) [0x00024] in <a2ae59b2c6064ca894b95b94571efabb>:0 
       --- End of inner exception stack trace ---
      at System.Net.Http.HttpContent.ReadBufferAsString (System.ArraySegment`1[T] buffer, System.Net.Http.Headers.HttpContentHeaders headers) [0x00040] in <a2ae59b2c6064ca894b95b94571efabb>:0 
      at System.Net.Http.HttpContent.ReadBufferedContentAsString () [0x00036] in <a2ae59b2c6064ca894b95b94571efabb>:0 
      at System.Net.Http.HttpContent+<>c.<ReadAsStringAsync>b__36_0 (System.Net.Http.HttpContent s) [0x00000] in <a2ae59b2c6064ca894b95b94571efabb>:0 
      at System.Net.Http.HttpContent.WaitAndReturnAsync[TState,TResult] (System.Threading.Tasks.Task waitTask, TState state, System.Func`2[T,TResult] returnFunc) [0x0006b] in <a2ae59b2c6064ca894b95b94571efabb>:0 
      at Bit.Core.Services.ApiService.SendAsync[TRequest,TResponse] (System.Net.Http.HttpMethod method, System.String path, TRequest body, System.Boolean authed, System.Boolean hasResponse) [0x002cc] in <6dfd726fecb34ba79c31a035ec98a215>:0 
      at Bit.Core.Services.AuthService.MakePreloginKeyAsync (System.String masterPassword, System.String email) [0x000b7] in <6dfd726fecb34ba79c31a035ec98a215>:0 
      at Bit.Core.Services.AuthService.LogInAsync (System.String email, System.String masterPassword) [0x00093] in <6dfd726fecb34ba79c31a035ec98a215>:0 
      at Bit.App.Pages.LoginPageViewModel.LogInAsync () [0x0036e] in <0c3398d4c9ce4e56ba576728f942d695>:0 
      at Bit.App.Pages.LoginPageViewModel.<.ctor>b__12_0 () [0x00062] in <0c3398d4c9ce4e56ba576728f942d695>:0 
      at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) [0x00000] in <8f1a893b5ab6478299d5fb8196347666>:0 
      at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in <3b6b09cca6ad40039584e80046fcd050>:0 
      at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <3b6b09cca6ad40039584e80046fcd050>:0 
      at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <3b6b09cca6ad40039584e80046fcd050>:0 
        at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.59(intptr,intptr)
        at mono.java.lang.RunnableImplementor.n_run(Native Method)
        at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7397)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)

On Another Phone (Mi Mix 2, Android 10, Lineage Os it's working)

Current Solution for Enduser: when you have a custom server set "https://url.domain.de" You need to add the Port and the error is gone like "https://url.domain.de:6266"

Edit After 1 successful Login the App keeps crashing when trying to login ...

AGXJXesJsc3ljB91d3yJHHkNyOT2eMxhRig6C58 commented 3 years ago

Same here. After adding my selfhosted server it works. But after locking and trying to unlock again it keeps crashing.

Android 10, Samsung Galaxy 20 FE.

Edit: If logout and relogin to my server I am able to work with app until I lock.

SVGZrS93IDb7HRG2Pg4rxerrtsFZW5Ad1otmeHQ commented 3 years ago

Same here 😥

Poco x3 NFC

First login is fine - try to unlock the vault to use it with an app it crashes. The only way I have gotten it to work is to logout fully for every auto fill.

UBvZqPIswlD2VNyaR0rlQFNyxI0l5hZToMdvTHt commented 3 years ago

Maybe this is related to my issue on the chrome plugin recently. When I want to login it says wrong password and I have to fully logout before I can login again. Should be fixed asap....

SVGZrS93IDb7HRG2Pg4rxerrtsFZW5Ad1otmeHQ commented 3 years ago

--------- beginning of crash 10-31 15:06:17.699 5895 5895 E AndroidRuntime: FATAL EXCEPTION: main 10-31 15:06:17.699 5895 5895 E AndroidRuntime: Process: com.x8bit.bitwarden, PID: 5895 10-31 15:06:17.699 5895 5895 E AndroidRuntime: android.runtime.JavaProxyThrowable: System.Exception: PBKDF2 iteration minimum is 5000. 10-31 15:06:17.699 5895 5895 E AndroidRuntime: at Bit.Core.Services.CryptoService.MakeKeyAsync (System.String password, System.String salt, System.Nullable1[T] kdf, System.Nullable1[T] kdfIterations) [0x00087] in <16b257e23b0d4535bc2f69f0b571f8e9>:0 10-31 15:06:17.699 5895 5895 E AndroidRuntime: at Bit.App.Pages.LockPageViewModel.SubmitAsync () [0x0078a] in <948e6adef7d049bf9ff84ebb9084fa59>:0 10-31 15:06:17.699 5895 5895 E AndroidRuntime: at Bit.App.Pages.LockPage.b17_1 () [0x00067] in <948e6adef7d049bf9ff84ebb9084fa59>:0 10-31 15:06:17.699 5895 5895 E AndroidRuntime: at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) [0x00000] in <74bfc0608a2a4b1cb730a27370b59f01>:0 10-31 15:06:17.699 5895 5895 E AndroidRuntime: at Android.App.SyncContext+<>cDisplayClass2_0.b__0 () [0x00000] in <3490c8702e6540b09381d2f1477448bb>:0 10-31 15:06:17.699 5895 5895 E AndroidRuntime: at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <3490c8702e6540b09381d2f1477448bb>:0 10-31 15:06:17.699 5895 5895 E AndroidRuntime: at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <3490c8702e6540b09381d2f1477448bb>:0 10-31 15:06:17.699 5895 5895 E AndroidRuntime: at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.51(intptr,intptr) 10-31 15:06:17.699 5895 5895 E AndroidRuntime: at mono.java.lang.RunnableImplementor.n_run(Native Method) 10-31 15:06:17.699 5895 5895 E AndroidRuntime: at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30) 10-31 15:06:17.699 5895 5895 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:883) 10-31 15:06:17.699 5895 5895 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:100) 10-31 15:06:17.699 5895 5895 E AndroidRuntime: at android.os.Looper.loop(Looper.java:224) 10-31 15:06:17.699 5895 5895 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7565) 10-31 15:06:17.699 5895 5895 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 10-31 15:06:17.699 5895 5895 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) 10-31 15:06:17.699 5895 5895 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

ABsIGdW8XeG0BJgvAnquIzSItI3pFWrbHmKxub3 commented 3 years ago

Same here. login to my selfhosted server it works. on Samsung S8 Android 9 first login is fine. unlock with Masterpassword - crash enter Pin in settings - crash

switching to fingerprints it works

on Samsung S7 no problems with Pin to unlock

UBvZqPIswlD2VNyaR0rlQFNyxI0l5hZToMdvTHt commented 3 years ago

I downloaded master and installed on my device. Problem is that the server is sending sth like "loading" and this crashes everything.

Server response: "<!DOCTYPE HTML>\n<html manifest=\"\">\n<head>\n\t<meta charset=\"UTF-8\">\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no\">\n\t<title>Title</title>\n\t<link href=\"/scripts/sencha-touch-2.4.1/resources/css/cupertino.css?v=25426\" rel=\"stylesheet\" type=\"text/css\">\n\t<link href=\"mobile/ui/style.css?v=25426\" rel=\"stylesheet\" type=\"text/css\">\n\t<link rel=\"shortcut icon\" href=\"webman/favicon.ico?v=25426\">\n\t<script type=\"text/javascript\" src=\"webapi/entry.cgi?api=SYNO.Core.Desktop.SessionData&amp;version=1&amp;method=getjs_mobile&amp;SynoToken=\"></script>\n\t<script type=\"text/javascript\" src=\"/scripts/sencha-touch-2.4.1/touch.js?v=25426\"></script>\n\t<script src=\"webapi/entry.cgi?api=SYNO.Core.Desktop.JSUIString&amp;version=1&amp;method=getjs&amp;lang=enu&amp;v=25426\"></script>\n\t<script src=\"webapi/entry.cgi?api=SYNO.Core.Desktop.UIString&amp;version=1&amp;method=getjs&amp;lang=enu&amp;v=25426\"></script>\n\t<script src=\"webapi/entry.cgi?api=SYNO.Core.Desktop.Defs&amp;version=1&amp;method=getjs&amp;v=25426&amp;SynoToken=\"></script>\n\t<script type=\"text/javascript\" src=\"mobile/ui/mobile.js?v=25426\"></script>\n\t<script type=\"text/javascript\" src=\"/synoSDSjslib/webapierrorcode.js?v=25426\"></script>\n\t\n</head>\n<body class=\"syno-mobile-body\">\n\t<div class=\"x-mask x-loading-mask syno-mask\" id=\"syno-mobile-preinit-mask\" style=\"width:100%; height: 100%;\">\n\t\t<div class=\"syno-mask-ct\" id=\"syno-mask-ct\">\n\t\t\t<div class=\"syno-mask-inner\" id=\"syno-mask-loading\">\n\t\t\t\t<div class=\"syno-loading-icon\"></div>\n\t\t\t\t<div class=\"syno-message x-mask-message syno-mask-message\">Loading...</div>\n\t\t\t</div>\n\t\t\t<div id=\"syno-non-admin-redirect\" style=\"visibility: hidden;\">\n\t\t\t\t<div class=\"syno-upper-part\"><span id=\"syno-non-admin-redirect-desc\"></span></div>\n\t\t\t\t<div class=\"syno-lower-part\"><a id=\"syno-non-admin-redirect-button\" class=\"x-syno-button\" href=\"/?forceDesktop=2\"></a></div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</body>\n</html>\n"

When you display this e.g. in Chrome you see:

"\n\n\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\n\n\t
\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t
Loading...
\n\t\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t
\n\n\n"

This is maybe related to the server and i'm not sure what the solution here would be. It occures in Api Service in SendAsync at JsonConvert.DeserializeObject

@mportune-bw and @vincentsalucci can you please have a look?

Could it because of 2-Faktor Auth?

It's not 2-Faktor auth. The Problem only appears when there is no Port given in Url of server (see initial post).

But then there appears a second Problem. When you want to login without completely logged out (you don't have to insert email) Then the App throws PBKDF2 iteration minimum is 5000. at CryptoService.cs at MakeKeyAsync and kdfIterationsis 0 -> That's the Bug that also appears in the Chrome Extension.

Not Working: Screenshot_20201106-164001_Bitwarden

Working: Screenshot_20201106-164012_Bitwarden

VFKkKXEOeJDDzWLL0MV6CAyqveYmapSJ3C6weKl commented 3 years ago

Same issue here now.

Selfhosted BW

Normal BW app from play store - Pixel 3, Samsung S8, and Samsung Tab8

First login is ok - Vault loads, etc.

Closing/locking app will cause app to cash after entering master password to unlock the vault.

Any fix for this yet? I see this is open since OCT???

UBvZqPIswlD2VNyaR0rlQFNyxI0l5hZToMdvTHt commented 3 years ago

ue here now.

Selfhosted BW

Normal BW app from play store - Pixel 3, Samsung S8, and Samsung Tab8

First login is ok - Vault loads, etc.

Closing/locking app will cause app to cash after entering master password to unlock the vault.

Any fix fo

Jeah i'm super upset, this is also the reason for the chrome addon to not work. They didn't even take a look at it .. and this is a heavy crash, people can't use their passwords ...

@mportune-bw and @vincentsalucci do you still work on bitwarden, could you take a look?

VFKkKXEOeJDDzWLL0MV6CAyqveYmapSJ3C6weKl commented 3 years ago

Oh wow! I didn't even put that together, you're right! This is an issue with the Chrome extension too!

I just thought I was doing something wrong with the password.

Is there a server side update on the docker images maybe that is causing this issue?

UBvZqPIswlD2VNyaR0rlQFNyxI0l5hZToMdvTHt commented 3 years ago

So 2 months Ago i posted this HUGE crash that seems to appear on all sort of devices (Android, Chrome Plugin, even IOS) and there has not been any progress yet .. not even a comment about it.

VFKkKXEOeJDDzWLL0MV6CAyqveYmapSJ3C6weKl commented 3 years ago

It seems I was able to resolve it by pulling the latest Docker container and moving to the BETA Android app.

Now the Chrome extension and the app work.

I assume there was an issue with my old docker pull, so you might want to try that.

mpbw2 commented 3 years ago

Is anyone seeing this crash while using our cloud service? And if you're self-hosted, are you using our latest docker images?

UBvZqPIswlD2VNyaR0rlQFNyxI0l5hZToMdvTHt commented 3 years ago

Is anyone seeing this crash while using our cloud service? And if you're self-hosted, are you using our latest docker images?

Jeah it's self hosted and on docker, should be Bitwarden_RS Version 1.14.2 but can't update at the moment because you changed alot in the release after this one and therefore the homeasssistant plugin got no update yet. If you tell me now that it's my fault because i didn't update - a password manager should be bricked when the client updates it's version. At least not without mentioning that there were breaking changes.

Could be an issue about Bitwarden_RS and not your fault. Would be very sorry about opening this issue here.

djsmith85 commented 2 years ago

I'm closing this now, as it seems to be related to not officially supported servers or add-ons. If you are still experiencing issues with the supported services, please feel free to re-open this issue and provide any further information that may be helpful in reproducing the problem or helping you further.