PhilippC / PhilippC/keepass2android

[BUG] App crash with autofill on some applications

Open
#2,488 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
6.2k
Forks
478
Avg merge
1h 4m
Merged PRs (30d)
2

Description

Checks
  • I have read the FAQ section, searched the open issues, and still think this is a new bug.
Describe the bug you encountered:

When typing OTP/PIN/fingerprint on some applications, the Keepass2Android app crashes and show a ANR dialog.

This situation happen mostly with the banking app Poste Italiane, like in the following screenshot.

Screenshot_20240101-132019

Here you can find the error verbose log:

01/01/2024 22:40:48:774 -- parsing autofillStructure... 01/01/2024 22:40:48:789 -- System.ArgumentNullException: Value cannot be null. Parameter name: key at System.Collections.Generic.Dictionary2[TKey,TValue].FindEntry (TKey key) [0x00008] in <4087c528abc04d8290db635003aa826f>:0
at System.Collections.Generic.Dictionary2[TKey,TValue].TryGetValue (TKey key, TValue& value) [0x00000] in <4087c528abc04d8290db635003aa826f>:0 at Kp2aAutofillParser.AutofillHintsHelper.ToCanonicalHint (System.String hint) [0x00000] in <b3fff3fe4c1d4e8994fd67a2f50d0277>:0 at System.Linq.Enumerable+SelectEnumerableIterator2[TSource,TResult].MoveNext () [0x00048] in <052d4ffc295b472ebae9750a0d92739d>:0
at System.Collections.Generic.HashSet1[T].UnionWith (System.Collections.Generic.IEnumerable1[T] other) [0x00026] in <052d4ffc295b472ebae9750a0d92739d>:0
at System.Collections.Generic.HashSet1[T]..ctor (System.Collections.Generic.IEnumerable1[T] collection, System.Collections.Generic.IEqualityComparer1[T] comparer) [0x0004c] in <052d4ffc295b472ebae9750a0d92739d>:0 at System.Linq.Enumerable.ToHashSet[TSource] (System.Collections.Generic.IEnumerable1[T] source, System.Collections.Generic.IEqualityComparer1[T] comparer) [0x0000e] in <052d4ffc295b472ebae9750a0d92739d>:0 at System.Linq.Enumerable.ToHashSet[TSource] (System.Collections.Generic.IEnumerable1[T] source) [0x00000] in <052d4ffc295b472ebae9750a0d92739d>:0
at Kp2aAutofillParser.StructureParserBase1[FieldT].Parse (System.Boolean forFill, System.Boolean isManualRequest, Kp2aAutofillParser.AutofillView1[TField] autofillView) [0x000b3] in :0
at keepass2android.services.AutofillBase.StructureParser.Parse (System.Boolean forFill, System.Boolean isManualRequest, Kp2aAutofillParser.AutofillView1[TField] autofillView) [0x0000d] in <fb40c821fb5144dda464d1c7539af8a0>:0 at keepass2android.services.AutofillBase.StructureParser.ParseForFill (System.Boolean isManual) [0x00018] in <fb40c821fb5144dda464d1c7539af8a0>:0 at keepass2android.services.AutofillBase.AutofillServiceBase.OnFillRequest (Android.Service.Autofill.FillRequest request, Android.OS.CancellationSignal cancellationSignal, Android.Service.Autofill.FillCallback callback) [0x0009f] in <fb40c821fb5144dda464d1c7539af8a0>:0 at Android.Service.Autofill.AutofillService.n_OnFillRequest_Landroid_service_autofill_FillRequest_Landroid_os_CancellationSignal_Landroid_service_autofill_FillCallback_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_request, System.IntPtr native_cancellationSignal, System.IntPtr native__callback) [0x00020] in <3e1504268cb1422b8c7c2994fae408c2>:0 at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_V (_JniMarshal_PPLLL_V callback, System.IntPtr jnienv, System.IntPtr klazz, System.IntPtr p0, System.IntPtr p1, System.IntPtr p2) [0x00005] in <3e1504268cb1422b8c7c2994fae408c2>:0 01/01/2024 22:40:53:59 -- Creating application keepass2android.keepass2android. Version=197 01/01/2024 22:40:53:186 -- parsing autofillStructure... 01/01/2024 22:40:53:215 -- System.ArgumentNullException: Value cannot be null. Parameter name: key at System.Collections.Generic.Dictionary2[TKey,TValue].FindEntry (TKey key) [0x00008] in <4087c528abc04d8290db635003aa826f>:0
at System.Collections.Generic.Dictionary2[TKey,TValue].TryGetValue (TKey key, TValue& value) [0x00000] in <4087c528abc04d8290db635003aa826f>:0 at Kp2aAutofillParser.AutofillHintsHelper.ToCanonicalHint (System.String hint) [0x00000] in <b3fff3fe4c1d4e8994fd67a2f50d0277>:0 at System.Linq.Enumerable+SelectEnumerableIterator2[TSource,TResult].MoveNext () [0x00048] in <052d4ffc295b472ebae9750a0d92739d>:0
at System.Collections.Generic.HashSet1[T].UnionWith (System.Collections.Generic.IEnumerable1[T] other) [0x00026] in <052d4ffc295b472ebae9750a0d92739d>:0
at System.Collections.Generic.HashSet1[T]..ctor (System.Collections.Generic.IEnumerable1[T] collection, System.Collections.Generic.IEqualityComparer1[T] comparer) [0x0004c] in <052d4ffc295b472ebae9750a0d92739d>:0 at System.Linq.Enumerable.ToHashSet[TSource] (System.Collections.Generic.IEnumerable1[T] source, System.Collections.Generic.IEqualityComparer1[T] comparer) [0x0000e] in <052d4ffc295b472ebae9750a0d92739d>:0 at System.Linq.Enumerable.ToHashSet[TSource] (System.Collections.Generic.IEnumerable1[T] source) [0x00000] in <052d4ffc295b472ebae9750a0d92739d>:0
at Kp2aAutofillParser.StructureParserBase1[FieldT].Parse (System.Boolean forFill, System.Boolean isManualRequest, Kp2aAutofillParser.AutofillView1[TField] autofillView) [0x000b3] in :0
at keepass2android.services.AutofillBase.StructureParser.Parse (System.Boolean forFill, System.Boolean isManualRequest, Kp2aAutofillParser.AutofillView1[TField] autofillView) [0x0000d] in <fb40c821fb5144dda464d1c7539af8a0>:0 at keepass2android.services.AutofillBase.StructureParser.ParseForFill (System.Boolean isManual) [0x00018] in <fb40c821fb5144dda464d1c7539af8a0>:0 at keepass2android.services.AutofillBase.AutofillServiceBase.OnFillRequest (Android.Service.Autofill.FillRequest request, Android.OS.CancellationSignal cancellationSignal, Android.Service.Autofill.FillCallback callback) [0x0009f] in <fb40c821fb5144dda464d1c7539af8a0>:0 at Android.Service.Autofill.AutofillService.n_OnFillRequest_Landroid_service_autofill_FillRequest_Landroid_os_CancellationSignal_Landroid_service_autofill_FillCallback_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_request, System.IntPtr native_cancellationSignal, System.IntPtr native__callback) [0x00020] in <3e1504268cb1422b8c7c2994fae408c2>:0 at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_V (_JniMarshal_PPLLL_V callback, System.IntPtr jnienv, System.IntPtr klazz, System.IntPtr p0, System.IntPtr p1, System.IntPtr p2) [0x00005] in <3e1504268cb1422b8c7c2994fae408c2>:0

Describe what you expected to happen:

The Keepass2Android should ignore that kind of authentication screen or, at least, it should ask for credentials without crashing.

What version of Keepass2Android are you using?

1.09e-r7

Which version of Android are you on?

14

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Kp2aAutofillParser.AutofillHintsHelper.ToCanonicalHint and follow its callers through StructureParserBase.Parse and AutofillServiceBase.OnFillRequest. Reproduce an autofill request on Android 14 using the reported banking-app scenario, then verify that null hints no longer cause the crash and that the app ignores the authentication screen or requests credentials.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, csharp
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.