Skip to content

Add support for URL wildcards and exact URL#9835

Merged
droidmonkey merged 3 commits intokeepassxreboot:developfrom
varjolintu:feature/add_support_for_url_wildcards
Feb 10, 2025
Merged

Add support for URL wildcards and exact URL#9835
droidmonkey merged 3 commits intokeepassxreboot:developfrom
varjolintu:feature/add_support_for_url_wildcards

Conversation

@varjolintu
Copy link
Copy Markdown
Member

@varjolintu varjolintu commented Sep 12, 2023

Adds support for URL wildcards and exact URL if the address is wrapped insinde " e.g. "https://example.com/page.php". Without wildcards, URL's are handled normally with the old/current implementation.

This feature is restricted to Additional URLs only, because storing URLs in wildcard form is not recommended, and it breaks the possibility to open the URL to a browser.

The wildcards can be used freely, and some example addresses are:

  • https://*.example.com/page/*
  • https://192.*.168.1/
  • subdomain.of.*.example.com/page/*/login

Fixes #3718.

Testing strategy

Manually, and added automatic tests.

Type of change

  • ✅ New feature (change that adds functionality)

@varjolintu varjolintu added this to the v2.8.0 milestone Sep 12, 2023
@varjolintu varjolintu changed the title Ddd support for URL wildcards and exact URL Add support for URL wildcards and exact URL Sep 12, 2023
@varjolintu varjolintu marked this pull request as draft September 12, 2023 07:20
@mfrakka

This comment has been minimized.

@varjolintu

This comment has been minimized.

@mfrakka

This comment has been minimized.

@mfrakka

This comment has been minimized.

@mfrakka

This comment has been minimized.

@droidmonkey

This comment has been minimized.

@mfrakka

This comment has been minimized.

@varjolintu
Copy link
Copy Markdown
Member Author

varjolintu commented Dec 4, 2023

TODO: Check if using https://doc.qt.io/qt-6/qregularexpression.html#wildcardToRegularExpression is preferred after Qt6 upgrade. Qt5 does not support https://doc.qt.io/qt-6/qregularexpression.html#WildcardConversionOption-enum.

@droidmonkey
Copy link
Copy Markdown
Member

Oh nice that will likely replace one of our tools functions.

@varjolintu varjolintu force-pushed the feature/add_support_for_url_wildcards branch from 029f28a to 590cd3c Compare February 3, 2025 06:12
@Shnoulle

This comment was marked as off-topic.

@varjolintu

This comment was marked as off-topic.

@droidmonkey droidmonkey force-pushed the feature/add_support_for_url_wildcards branch from 62f2a34 to c34d1bd Compare February 9, 2025 20:02
@droidmonkey droidmonkey merged commit 9ba6ada into keepassxreboot:develop Feb 10, 2025
2 checks passed
@droidmonkey
Copy link
Copy Markdown
Member

@varjolintu I messed around with this a little and I think the invalid URL tester still needs some work:

image

@droidmonkey droidmonkey added the pr: backported Pull request backported to previous release label Feb 11, 2025
droidmonkey added a commit that referenced this pull request Feb 11, 2025
* Add support for URL wildcards with Additional URL feature

* Only check TLD if wildcard is used

* Avoid using network function in no-feature build

---------

Co-authored-by: varjolintu <sami.vanttinen@ahmala.org>
Co-authored-by: Jonathan White <support@dmapps.us>
@varjolintu varjolintu deleted the feature/add_support_for_url_wildcards branch February 11, 2025 05:50
@varjolintu
Copy link
Copy Markdown
Member Author

@droidmonkey I'll make a quick fix to it.

pull bot pushed a commit to blog2i2j/keepassxreboot.._..keepassxc that referenced this pull request Feb 22, 2025
* Add support for URL wildcards with Additional URL feature

* Only check TLD if wildcard is used

* Avoid using network function in no-feature build

---------

Co-authored-by: varjolintu <sami.vanttinen@ahmala.org>
Co-authored-by: Jonathan White <support@dmapps.us>
@leventov
Copy link
Copy Markdown

Does this work in Linux? KeepPassXC 2.7.10:

image

@varjolintu
Copy link
Copy Markdown
Member Author

@leventov You can use https://vercel.app to cover all subdomains. No need for wildcards with that.

@leventov
Copy link
Copy Markdown

@varjolintu doesn't work for me. "Error no logins found" when I press the KeePassXC icon inside the Email field on the login page in my-random-subdomain.vercel.app. https://vercel.app is set both as the main entry's URL and in additional URLs in browser integration.

@droidmonkey
Copy link
Copy Markdown
Member

You probably denied access at some point. Go to the properties page of the entry and look for any custom data for browser remove it if it's there

@leventov
Copy link
Copy Markdown

@droidmonkey no properties it seems:

image image

@droidmonkey
Copy link
Copy Markdown
Member

droidmonkey commented Oct 31, 2025

Did you disable access to browser from the group or entry level?

What is the exact error message in browser? You chopped off the domain portion. Wondering if this is an odd ball iframe issue.

@leventov
Copy link
Copy Markdown

@droidmonkey no, and other entries in this group do work in the browser.

Are you sure if I specify https://vercel.app it should work for arbitrary subdomains?

@leventov
Copy link
Copy Markdown

The exact error message is Error! No login found. https://my-dev-website-subdomain.vercel.app

No iframes are involved, these are just regular Vercel Preview deployments

@varjolintu
Copy link
Copy Markdown
Member Author

The exact error message is Error! No login found. https://my-dev-website-subdomain.vercel.app

No iframes are involved, these are just regular Vercel Preview deployments

Does https://vercel.app work if you set it as the entry URL instead of an additional one?

@droidmonkey
Copy link
Copy Markdown
Member

Very odd but I can absolutely replicate this problem on 2.7.10. Have not tried develop branch yet. Here is a good test site to use: https://your-app.vercel.app/

@varjolintu
Copy link
Copy Markdown
Member Author

varjolintu commented Nov 1, 2025

Very odd but I can absolutely replicate this problem on 2.7.10. Have not tried develop branch yet. Here is a good test site to use: https://your-app.vercel.app/

So it seems. The exact URL works, but not the domain one. Develop branch doesn't work either. It fails to the getBaseDomainFromUrl() check. I'll edit the message when I see the actual reason.

EDIT: The TLD check does not handle that URL correctly. Instead of .app it returns vercel.app. According to the Public Suffix List, vercel.app is set as a TLD: https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/io/qurltlds_p.h?h=5.15&id=64bbc48867bb4229ceec81f89cbc4aea14dfbd36#n14537

However, if I put https://*.vercel.app to the Additional URLs list, everything works just fine. The UI just complains the URL is not valid. This works with both 2.7.10 and the current develop branch.

@droidmonkey
Copy link
Copy Markdown
Member

droidmonkey commented Nov 1, 2025

Might need a hardcoded exception here. We should also be flagging this one as "TLD Only" in the UI, not sure why that wasn't caught. Based on the Qt list this would be equivalent to having a url of https://com. I think we pass it because it has a dot in the url, but it should fail the TLD-only check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: Browser pr: backported Pull request backported to previous release pr: new feature Pull request adds a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow limited wildcard matching for Browser Integration URLs

6 participants