Repository navigation
fix remaining weak-sensitive-data-hashing alert in engine - #75
FabioLeitao wants to merge 1 commit into
Conversation
Replace direct sha256 with blake2b in AuditEngine scope digest and add focused tests for stable and changed-scope behavior. Made-with: Cursor
| parts.append("extensions:" + ",".join(sorted(str(e) for e in exts))) | ||
| blob = "\n".join(sorted(parts)).encode("utf-8") | ||
| return hashlib.sha256(blob).hexdigest() | ||
| return hashlib.blake2b(blob, digest_size=32).hexdigest() |
Check failure
Code scanning / CodeQL
Use of a broken or weak cryptographic hashing algorithm on sensitive data High
Copilot Autofix
AI 8 months ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
|
Superseded by #76 (merged): config scope digest now uses PBKDF2-HMAC-SHA256, which satisfies CodeQL \py/weak-sensitive-data-hashing. The BLAKE2b approach on this branch still triggers the same rule (fast hash on tainted config fields) and would merge-conflict with \main. Closing to avoid a dangling PR; delete branch \pr/security-weak-hash-engine-scope\ when convenient. |
Summary
sha256usage incore/engine.pyconfig-scope digest with deterministicblake2btests/test_engine_scope_hash.pyTest plan
python -m pytest tests/test_engine_scope_hash.py -qMade with Cursor