Fix all high and medium severity security issues found by Bandit
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
+2
-1
@@ -62,7 +62,8 @@ def require_login(func):
|
||||
def get_gravatar_url(email):
|
||||
"""Generate a Gravatar URL for the given email"""
|
||||
email = email.lower().strip()
|
||||
email_hash = hashlib.md5(email.encode('utf-8')).hexdigest()
|
||||
# MD5 is used here for Gravatar's URL generation (not for security), so usedforsecurity=False
|
||||
email_hash = hashlib.md5(email.encode('utf-8'), usedforsecurity=False).hexdigest()
|
||||
return f"https://www.gravatar.com/avatar/{email_hash}?d=identicon"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user