1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 14:53:33 +00:00

Merge pull request #1407 from bitwarden/tighten-autofill-non-password

beefed up restrictions on what is considered isLikePassword
This commit is contained in:
Addison Beck
2020-09-28 18:19:59 -04:00
committed by GitHub

View File

@@ -903,16 +903,18 @@ export default class AutofillService implements AutofillServiceInterface {
if (value == null) { if (value == null) {
return false; return false;
} }
const lowerValue = value.toLowerCase(); // Removes all whitespace, _ and - characters
if (lowerValue.indexOf('onetimepassword') >= 0) { const cleanedValue = value.toLowerCase().replace(/[\s_\-]/g, '');
if (cleanedValue.indexOf('password') < 0) {
return false; return false;
} }
if (lowerValue.indexOf('password') < 0) {
return false; const ignoreList = ['onetimepassword', 'captcha', 'findanything'];
} if (ignoreList.some((i) => cleanedValue.indexOf(i) > -1)) {
if (lowerValue.indexOf('captcha') >= 0) {
return false; return false;
} }
return true; return true;
}; };
const isLikePassword = () => { const isLikePassword = () => {