diff --git a/.jules/sentinel.md b/.jules/sentinel.md index dd72493c0..a58dd10fe 100644 --- a/.jules/sentinel.md +++ b/.jules/sentinel.md @@ -1,7 +1,7 @@ -## 2024-07-09 - Replace weak MD5 hashing with SHA-256 for caching +## 2026-07-09 - Replace weak MD5 hashing with SHA-256 for caching **Vulnerability:** Weak MD5 hashes were being used for generating cache keys and processing IDs across multiple backend services (e.g., `cache_service.py`, `database_optimizer.py`, etc.). **Learning:** This repo frequently uses hashes for non-cryptographic purposes (caching and IDs). However, using MD5 triggers static analysis security warnings (like Bandit rules B324/B303) as the algorithm is vulnerable to collision attacks and considered insecure by modern cryptographic standards. -**Prevention:** Avoid using `hashlib.md5()` entirely. Default to `hashlib.sha256()` even for non-cryptographic uses to maintain a secure baseline and comply with automated security policies. +**Prevention:** Avoid using `hashlib.md5()` in the `src/` directory. Default to `hashlib.sha256()` even for non-cryptographic uses to maintain a secure baseline and comply with automated security policies. Archived scripts in `scripts/archive/` are explicitly excluded from this requirement. ## 2026-07-15 - Prevent Information Disclosure in 500 Responses **Vulnerability:** API routes were returning internal server exceptions and stack traces directly to the client via `HTTPException(..., detail=str(e))`. **Learning:** Developers often unintentionally leak sensitive deployment context (e.g., paths, database errors) when relying on generic exception catching blocks.