-
-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Improvement: No "Fill TOTP from KeePassXC" in postal/zip_code fields #768
Comments
Support for Some negative check might indeed be needed because most sites are not using that autocomplete property at all. |
More stuff going wrong: <input type="text" autocomplete="off" class="code_box code_box_length_4" placeholder=" " id="app_verification_code_verification_code_field_0" maxlength="1"> is recognized as TOTP (note the The password field in https://digid.nl/inloggen_basis is also recognized as TOTP because of: <input hide_required_indicator="true" class="form__item__field" placeholder=" " autocomplete="off" data-required="true" type="password" name="authentication[password]" id="authentication_password"> Also filling in a SMS token on https://digid.nl/sms_controleren triggers the TOTP again: <input type="number" autocomplete="off" class="code_box code_box_length_6" placeholder=" " id="smscode_smscode_field_0" maxlength="1"> |
Too short What makes using the regex difficult, is that for example The TOTP icon on the password input field missed a check for |
I made a PR that should solve this issue. Instead of one big regex I just used a simpler one and checked both name and id before creating the icon. This should cover all possible situations. |
See
![image](https://user-images.githubusercontent.com/4252918/74044580-8e21f400-49cb-11ea-8820-695977c227c0.png)
When there is a
<input name=postal_code id=zipcode>
wherecode
is included in name or id, the "Fill TOTP from KeePassXC" is triggered.Expected Behavior
No "Fill TOTP from KeePassXC" on zipcode or postalcode fields.
Current Behavior
"Fill TOTP from KeePassXC" on postal or zipcode fields.
See
keepassxc-browser/keepassxc-browser/content/keepassxc-browser.js
Lines 9 to 17 in b01ab1e
and
keepassxc-browser/keepassxc-browser/content/keepassxc-browser.js
Lines 996 to 998 in b01ab1e
Possible Solution
Change to regex with some negative check:
/^(((?!zip|post).)*code.*)|(.*(2fa|auth|challenge|mfa|otp|token).*)$/i
The
otp
andmfa
are very short identifiers, see:Maybe a score calculation is possible:
type=number
maxlength=6
(or 8)Or skip this all and just rely on
autocomplete=one-time-code
Debug info
KeePassXC - 2.5.3
KeePassXC-Browser - 1.5.4
Operating system: Linux x86_64
Browser: Mozilla Firefox 74.0
The text was updated successfully, but these errors were encountered: