From 56b2f3afcfa0dbb266111bfc225bc83fce8e0efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=8A?= Date: Mon, 25 May 2026 17:29:39 +0530 Subject: [PATCH] Potential fix for code scanning alert no. 134: Use of a broken or weak cryptographic hashing algorithm on sensitive data Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .../services/content_strategy/performance/caching.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/api/content_planning/services/content_strategy/performance/caching.py b/backend/api/content_planning/services/content_strategy/performance/caching.py index faeaa230..55a94cc7 100644 --- a/backend/api/content_planning/services/content_strategy/performance/caching.py +++ b/backend/api/content_planning/services/content_strategy/performance/caching.py @@ -79,8 +79,8 @@ class CachingService: if kwargs: key_data += ":" + json.dumps(kwargs, sort_keys=True) - # Create hash for consistent key length - key_hash = hashlib.md5(key_data.encode()).hexdigest() + # Create hash for consistent key length using a strong hash algorithm + key_hash = hashlib.sha256(key_data.encode("utf-8")).hexdigest() return f"content_strategy:{cache_type}:{key_hash}" except Exception as e: