1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-28 12:45:45 +01:00

beefed up the restrictions on what is considered isLikePassword for autofill

This commit is contained in:
Addison Beck 2020-09-25 12:43:29 -04:00
parent 16354f2693
commit 307f59065b
2 changed files with 12 additions and 8 deletions

2
jslib

@ -1 +1 @@
Subproject commit 3bf322a904cd7ccb8c7e77edbecf8e152feb7364
Subproject commit f30d6f8027055507abfdefd1eeb5d9aab25cc601

View File

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