-
-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URL matching fails in presence of a path #1940
Comments
I've looked at database/src/main/java/com/kunzisoft/keepass/database/search/SearchHelper.kt stringToCheck.endsWith("/$word", !searchParameters.caseSensitive) If I have the following URL in my KeePass database: It will match on https://login.sh/. This isn't only wrong but if the path can be registered as a domain, it can be used for phishing. In a LAN this might even work with just a hostname (e.g. http://login/ or http://signin). |
I agree, it's not ideal at all. The problem, as I said, is to use an algorithm that doesn't take time to search. I'd already tried accent searching and it caused ANRs. I'm afraid it'll do the same thing with URL objects. I'll give it a try anyway. |
I'll add unit tests to handle all cases. If anyone sees anything missing, don't hesitate to tell me. |
Unit tests :
|
I don't know how to write code in Kotlin, but maybe I can provide some pseudocode: // stringtomatch contains the URL from each entry the database // extract the hostname from the URL // if enabled, check if hostname is a subdomain of word // no matching URL
|
As for unit tests I would recommend adding the following checks: assertFalse(expected.inTheSameDomainAs("https://example.com/domain.org", sameSubDomain = true)) |
Describe the bug
Autofill sugggestions are not matched to existing entries anymore, if the URL in the database includes any path after the hostname. This used to work fine until 4.0.8.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Step 3 should not be necessary, if you have the login URL in your KeePass database entry.
KeePass Database
content://
URI): content://com.android.externalstorage.documents/document/primaryKeePassDX:
Android:
Additional context
If you change the URL to https://github.com without any path in your KeePass database or add another URL item to it (URL_1), the problem can be worked around.
This issue results from the changes to fix #1820.
The text was updated successfully, but these errors were encountered: