Now Hacked
EN

Daily security quiz #10

Question for 2026-11-10. Read the code and pick the most serious security vulnerability.

HardPython2026-11-10

This code verifies a signature to check whether a webhook request came from a legitimate sender. What is the most serious vulnerability?

import hmac, hashlib
 
SECRET = load_secret()
 
def verify(body: bytes, signature: str) -> bool:
    expected = hmac.new(SECRET, body, hashlib.sha256).hexdigest()
    return expected == signature

Past questions