You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem Statement quantara/web_app/telegram/utils.py:
ifhash_value!=check_hash:
returnFalse
String equality != short-circuits on first byte mismatch. A timing
attacker who can observe the auth endpoint signing latency can in
principle recover a valid hash byte-by-byte.
Expected Outcome
Replace with hmac.compare_digest(hash_value, check_hash).
Acceptance Criteria
Existing tests pass.
Micro-benchmark: 100k iterations of full-vs-prefix mismatch shows all within 0.001ms.
Implementation Notes
One-line. Both arguments must be str for compare_digest; cast if needed.
Difficulty: good-first-issue · Effort: XS · Impact: Telegram bot auth
Problem Statement
quantara/web_app/telegram/utils.py:String equality
!=short-circuits on first byte mismatch. A timingattacker who can observe the auth endpoint signing latency can in
principle recover a valid hash byte-by-byte.
Expected Outcome
Replace with
hmac.compare_digest(hash_value, check_hash).Acceptance Criteria
Implementation Notes
One-line. Both arguments must be
strforcompare_digest; cast if needed.Files / Modules Affected
quantara/web_app/telegram/utils.pyquantara/web_app/tests/test_telegram.pyDependencies: standalone.