Idempotency keys

APIs that accept Idempotency-Key headers but scope them wrong, ignore them on mutating verbs, or collide keys across tenants.

1 മിനിറ്റ് വായന2026 ഒക്ടോ 2-ന് അപ്ഡേറ്റ് ചെയ്തുflorianamette1 സംഭാവകൻ
നിങ്ങളുടെ അസിസ്റ്റന്റിനോട് ചോദിക്കുക (MCP)GitHub-ൽ എഡിറ്റ് ചെയ്യുക

Context#

Clients send Idempotency-Key (or similar) so retries do not double-charge. Bugs appear when keys are ignored on PATCH, shared across users, truncated, or cleared after a short TTL while the client still retries.

Theory#

Correct behavior: same key + same body → same effect; same key + different body → 409 or clear error. Many implementations skip the body hash.

Practice#

  • Replay the same POST with the same key and a changed amount in a sandbox; compare responses and backend state.

Tools#

  • curl with custom headers
  • Burp Suite

References#

  • PortSwigger Web Security Academy: Race conditions
  • OWASP WSTG: Testing for Business Logic