diff --git a/wagtail/admin/staticfiles.py b/wagtail/admin/staticfiles.py index 6d631d90f0..f973aa75b3 100644 --- a/wagtail/admin/staticfiles.py +++ b/wagtail/admin/staticfiles.py @@ -29,6 +29,7 @@ except AttributeError: if use_version_strings: + # SECRET_KEY is used to prevent exposing the Wagtail version VERSION_HASH = hashlib.sha1( (__version__ + settings.SECRET_KEY).encode("utf-8") ).hexdigest()[:8] diff --git a/wagtail/admin/urls/__init__.py b/wagtail/admin/urls/__init__.py index 74dc533314..8c31e7c49d 100644 --- a/wagtail/admin/urls/__init__.py +++ b/wagtail/admin/urls/__init__.py @@ -131,6 +131,7 @@ def get_sprite_hash(): global sprite_hash if not sprite_hash: content = str(home.sprite(None).content, "utf-8") + # SECRET_KEY is used to prevent exposing the Wagtail version sprite_hash = hashlib.sha1( (content + settings.SECRET_KEY).encode("utf-8") ).hexdigest()[:8]