From 0ff9f9d5a2e1871a8fb236d9bc757fc9a18c7c0f Mon Sep 17 00:00:00 2001 From: Shyam Sunder Date: Sun, 12 Jan 2020 12:54:28 -0500 Subject: [PATCH] server/func/posts: explicity specify MD5 for post security hash --- server/szurubooru/func/posts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/szurubooru/func/posts.py b/server/szurubooru/func/posts.py index 532bd23d..ee58633b 100644 --- a/server/szurubooru/func/posts.py +++ b/server/szurubooru/func/posts.py @@ -88,7 +88,8 @@ FLAG_MAP = { def get_post_security_hash(id: int) -> str: return hmac.new( config.config['secret'].encode('utf8'), - str(id).encode('utf-8')).hexdigest()[0:16] + msg=str(id).encode('utf-8'), + digestmod='md5').hexdigest()[0:16] def get_post_content_url(post: model.Post) -> str: