Browse Source

Merge pull request #12293 from saurabh6790/validate-user-key

fix: validate the key type while updating the password
version-14
Saurabh 4 years ago
committed by GitHub
parent
commit
d2b61f333c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      frappe/core/doctype/user/user.py

+ 4
- 0
frappe/core/doctype/user/user.py View File

@@ -562,6 +562,10 @@ def get_perm_info(role):

@frappe.whitelist(allow_guest=True)
def update_password(new_password, logout_all_sessions=0, key=None, old_password=None):
#validate key to avoid key input like ['like', '%'], '', ['in', ['']]
if key and not isinstance(key, str):
frappe.throw(_('Invalid key type'))

result = test_password_strength(new_password, key, old_password)
feedback = result.get("feedback", None)



Loading…
Cancel
Save