1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-07-08 12:35:09 +02: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
commit 1375b422c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 = () => {