HMAC Signatures Verify Origin But Not Timing, Leaving APIs Open to Replay Attacks
HMAC-based API authentication confirms that a request originated from a known secret holder and was not tampered with in transit, but it does not verify when the request was made or whether it has been processed before. Because HMAC-SHA256 is deterministic, a captured signed request remains valid indefinitely if no timestamp or nonce is included in the signed payload. Real-world cases illustrate the risk: RBKmoney accepted replayed Apple Pay cryptograms for repeated charges, while Shopify's checkout webhook lacked HMAC verification entirely, allowing unsigned payment events to be resent freely. MITRE classifies this pattern as CWE-294 (Authentication Bypass by Capture-replay), and the flaw has recurred across multiple generations of API libraries, including a 2013 OAuth vulnerability and a March 2026 Mattermost Zoom plugin bug. Developers can close the gap by including a timestamp or nonce inside the signed payload and rejecting requests that fall outside a narrow validity window, a practice formalized by Stripe's widely referenced webhook security model.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in