Skip to content

Commit

Permalink
Fix TOTP detection that are password fields (like HackerOne).
Browse files Browse the repository at this point in the history
  • Loading branch information
bwbroersma committed Sep 7, 2024
1 parent aa288ff commit cde0aa8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion keepassxc-browser/content/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ kpxcFields.getAllCombinations = async function(inputs) {
continue;
}

if (input.getLowerCaseAttribute('type') === 'password') {
if (input.getLowerCaseAttribute('type') === 'password' && !kpxcTOTPIcons.isAcceptedTOTPField(input)) {
const combination = {
username: (!usernameField || usernameField.size < 1) ? null : usernameField,
password: input,
Expand Down
4 changes: 2 additions & 2 deletions keepassxc-browser/content/totp-field.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const ignoreRegex = /(bank|coupon|postal|user|zip).*code|comment|author|error/i;
const ignoredTypes = [ 'email', 'password', 'username' ];
const ignoreRegex = /(bank|coupon|postal|user|zip)((?!(\b|_)totp(\b|_)).)*code|comment|author|error/i;
const ignoredTypes = [ 'email', 'username'];

const acceptedOTPFields = [
'2fa',
Expand Down

0 comments on commit cde0aa8

Please sign in to comment.