mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-30 13:03:53 +01:00
beefed up the restrictions on what is considered isLikePassword for autofill
This commit is contained in:
parent
16354f2693
commit
307f59065b
2
jslib
2
jslib
@ -1 +1 @@
|
||||
Subproject commit 3bf322a904cd7ccb8c7e77edbecf8e152feb7364
|
||||
Subproject commit f30d6f8027055507abfdefd1eeb5d9aab25cc601
|
@ -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 = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user