From 5a12bf951a3004e935403908b501f2690387a15e Mon Sep 17 00:00:00 2001 From: Jonas Braathen Date: Fri, 23 Oct 2026 02:18:16 +0200 Subject: [PATCH] Hash Gravatar emails with SHA-256 --- bbs/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bbs/models.py b/bbs/models.py index b9ddde0..067d75a 100755 --- a/bbs/models.py +++ b/bbs/models.py @@ -245,8 +245,8 @@ class UserProfile(models.Model): def image_url(self) -> str: if self.user.email: - md5_hash = hashlib.md5(self.user.email.lower().strip().encode()).hexdigest() # noqa: S324 - return f"https://www.gravatar.com/avatar/{md5_hash}?d=identicon" + sha256_hash = hashlib.sha256(self.user.email.lower().strip().encode()).hexdigest() + return f"https://www.gravatar.com/avatar/{sha256_hash}?d=identicon" return ""