bitwarden / android

Bitwarden mobile app for Android.
https://bitwarden.com
GNU General Public License v3.0
5.86k stars 763 forks source link

Match detection "Host" not working #3341

Open larena1 opened 1 week ago

larena1 commented 1 week ago

Steps To Reproduce

  1. Create entry with URL https://example.com and match detection "Host"
  2. Navigate to example.com in Chrome
  3. Check native autofill

Expected Result

Entry should be suggested

Actual Result

No suggestions

Screenshots or Videos

No response

Additional Context

No response

Build Version

Native beta 2024.06.00

Environment Details

No response

Issue Tracking Info

sammbw commented 1 week ago

Hi there,

I am unable to reproduce this issue, it has been escalated for further investigation. If you have more information that can help us, please add it below.

Thanks!

larena1 commented 1 week ago

The match detection type might also be called "host" instead of "server" depending on the language. I set my GitHub login to that match detection type and autofill will not suggest me that entry anymore after.

larena1 commented 1 week ago

@lucas-livefront since you implemented https://github.com/bitwarden/android/commit/0c6ea8d18da02c7e13f458c0d052fa293df63f70

It seems host matching requires a port now but I think Android native autofill does never supply a port and most people probably also don't store their entries with a port in the URL. Could that be the issue why host matching is not working currently anymore?

https://github.com/bitwarden/android/commit/0c6ea8d18da02c7e13f458c0d052fa293df63f70#diff-4b72c0b9932ed2cc3fd655597753819c2062f63eb4b5ef3151d9cb78f8c3aa15R207

otaconix commented 21 hours ago

I'm running into the same issue. What's interesting is that, when I manually lookup the entry I want through the auto-fill flow and tell Bitwarden to "Auto-fill and save", the URL added to the item is exactly the same as another one that was already there.

I haven't grokked the code I've been looking at entirely, but it looks like @larena1's analysis is right on the money. Most URLs are unlikely to contain an explicit port, as they tend to use the implicit default (80 for HTTP and 443 for HTTPS).

If there's anything I can do to help debug this further, let me know!