今日安全题 #10
这是 2026-11-10 的题目。 阅读代码,选出最严重的安全漏洞。
这段代码通过验证签名来确认 webhook 请求是否来自合法发送方。最严重的漏洞是什么?
import hmac, hashlib
SECRET = load_secret()
def verify(body: bytes, signature: str) -> bool:
expected = hmac.new(SECRET, body, hashlib.sha256).hexdigest()
return expected == signature