Enforce Idempotency-Key on ingress to block naive replays #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The ingress handler currently reads the
Idempotency-Keyheader and passes it through to the dispatcher (cbcl-ingress-handler.lfe:39), but the dispatcher doesn't use it for replay protection — every POST mints a fresh receipt regardless of whether the same key has been seen recently. An attacker who captures a(lang elf (ask @router "do-work" …))from a network trace can re-POST it and the work re-dispatches.Mitigation
Treat
Idempotency-Keyas authoritative when present:(principal, key)has been submitted in the last N minutes (window TBD; suggest 1h), return the prior{receipt_id, seq, capability, dispatched_to}instead of dispatching again.Storage can be a small in-memory ETS table with TTL eviction (or piggyback on
cbcl-storage). Keyed by(principal, key)so different principals using the same string don't collide.Acceptance
cbcl-ingress-handler(or a newcbcl-idempotency-storegen_server) caches(principal, key) → ReceiptResponsewith TTL.cbcl-dispatcher:submit.Idempotency-Key: behaviour unchanged.Out of scope
See discussion in hark conversation on the dialect-distribution threat model.