Webhook Reliability and Event Ordering in Security Platform Integrations
Duplicate and out-of-order webhooks can silently break security responses without triggering alerts.

A webhook is an HTTP POST request, fired by a source system the instant something happens. The receiver has to accept it and acknowledge it, usually within 3 to 20 seconds, or the sending system marks the delivery as failed and tries again.
That retry is where most teams get the contract wrong. Almost every webhook system promises at-least-once delivery, not exactly-once, and treating those as interchangeable is the mistake that causes everything downstream. Networks retry. Providers re-send on ambiguous timeouts. A slow response looks identical to a lost one from the sender's side, so it gets retried too. Duplicates aren't some rare edge case an engineer forgot to handle. They're baked into how the whole system is supposed to work, and any integration that treats them as an exception rather than the default is already behind before it ships.
Order isn't guaranteed either. A "device enrolled" event can show up after "policy applied to device." A "threat resolved" event can land before "threat detected" ever arrives. The system sending events controls the timing entirely, and the system receiving them controls none of it. That imbalance is the root of nearly every ordering and duplication problem that shows up downstream.
The standard workaround is to process events asynchronously: return an HTTP 200 immediately so the sender doesn't think the delivery failed, then hand the actual work off to a background queue. That workaround only counts as done when five specific things are in place: signature verification, idempotency keys, retry handling for downstream failures, explicit tolerance for out-of-order arrival, and a dead-letter queue for anything that keeps failing. Skip any one of those and the integration doesn't degrade gracefully. It collapses, quietly, and usually not on the day someone's watching.
What out-of-order and duplicate delivery actually breaks in a security context
In most software, a duplicate event means a double-charged customer or a repeated database row. Annoying, but recoverable. In a security integration, the same failure mode changes shape entirely. The cost isn't a refund, it's a threat that never gets contained because the system thinks someone already handled it.
Picture a "threat detected" webhook that arrives after a "threat remediated" webhook, because of a network hiccup or a retry delay. The integration marks the device clean first, then the delayed alert comes in and either gets treated as a duplicate and dropped, or worse, it fires a response action against a threat that's already been handled. Neither outcome is acceptable. One buries a real signal. The other burns analyst time on a phantom problem.
Now take the duplicate case directly. An idempotency gap causes a "user account locked" event to fire twice. A human operator manually unlocks the account in between the two firings, doing exactly what they're supposed to do. The second event comes through and re-locks it, erasing a deliberate decision without anyone touching a keyboard.
There's a subtler version of this, tied to how a lot of handlers get written. Code that does something like status = event['status'], applying the raw value from the event directly, will happily let a delayed intermediate event overwrite a terminal one. An incident that's been reviewed and closed by a human gets silently reopened because a stale event finally showed up. The recurring failure mode in long-running automated workflows, where asynchronous tool responses arrive out of sequence, stems from this same design flaw rather than bad luck. As more security workflows get triggered by autonomous agents rather than humans, this only gets worse: an autonomous producer sending events faster and more often just amplifies whatever weakness already exists in the pipeline.
The attack surface that delivery failures open: spoofing, replay, and silent forgery
A webhook endpoint is a public URL sitting on the internet, accepting POST requests. Without verification, anything that can find the URL can send it a fabricated event and have it processed like the real thing.
Spoofing is the most direct version. An attacker who discovers a webhook URL can send a forged "compliance check passed" or "payment succeeded" event, and if there's no verification step, the receiving system's business logic just runs on it as though it were legitimate. No breach of the sending system required. Just a guessed or leaked URL and a well-formed payload.
Replay is subtler, and it survives even decent defenses. A validly signed webhook, captured somewhere in transit, can be resent later, and HMAC signature verification alone won't stop it. The signature is still mathematically valid; the payload hasn't changed. A replayed "access granted" event sent hours or days after the original is just as cryptographically clean as the first time it went out.
The industry data on this should worry anyone running these integrations. According to RealtyAPI, 65% of webhook services use HMAC authentication, 16% ship with no authentication at all, and only 30% add any kind of replay protection on top of signing. That gap between "signed" and "replay-proof" is exactly where an attacker with a captured payload operates. Separate estimates put the share of webhook integrations that actually verify signatures in production at around 30%. Read that directly: most deployed integrations right now accept events with no authentication check whatsoever, and that's closer to the median than a fringe misconfiguration.
Payload tampering runs alongside this. Data modified in transit gets processed as though it were clean, and without signature verification, that corruption goes completely undetected. And any feature that lets a server make an HTTP request to a user-supplied URL, like a webhook replay or relay destination, opens up Server-Side Request Forgery risk. Point that feature at an internal metadata endpoint instead of a real webhook target, and an attacker can pull credentials straight out of infrastructure that was meant to stay off the internet.
Signature verification and replay protection: the baseline every integration must meet
HMAC-SHA256 is the standard most major platforms use to sign payloads with a shared secret; some still use HMAC-SHA1, which is weaker and shouldn't be the default choice for anything new. The receiver recomputes the hash against the raw request body and compares it to what came in. If the two don't match, the request gets rejected before any business logic touches it.
Two mistakes routinely defeat this protection even when it's technically implemented, and both are avoidable, which is what makes them frustrating. First, comparing signatures using regular string equality instead of constant-time comparison, which opens the door to timing attacks that recover the signature byte by byte. Second, parsing the JSON body before verifying the signature. Reparsed JSON can differ from the raw body in whitespace or key ordering, which breaks the hash match and either causes false rejections or, worse, gets "fixed" by developers who weaken the check just to make it pass.
Signing alone doesn't stop replay. That takes a timestamp baked into the signed payload, with the receiver rejecting anything outside an acceptable window, usually a few minutes. That single check turns a captured, valid signature into something useless once the acceptable window closes.
A few operational habits round this out. Webhook secrets belong in environment variables or a dedicated secrets manager, never hardcoded or committed to a repository. Long-lived secrets should give way to short-lived, automatically rotated signing keys, a practice increasingly recommended for new integrations. TLS matters more than people give it credit for: Let's Encrypt certificates expire every 90 days, and a failed auto-renewal produces no error on the consumer side. Events just stop arriving, and the integration looks healthy right up until someone notices a gap in the logs. Payload size limits matter too. Most webhook payloads run under 100KB, so an endpoint that accepts arbitrarily large bodies is exposing itself to memory exhaustion for no operational reason.
Idempotency and state-based processing: making handlers safe to run more than once
Idempotency means running a handler twice produces the same result as running it once. It's the consumer's answer to a delivery guarantee that promises at-least-once and nothing cleaner.
The mechanical version of this is a deduplication store, keyed on the provider's event ID. Before processing anything, check whether that ID has already been recorded. If it has, return success and skip the actual work. This store has to be durable, not something sitting in memory, or a restart wipes out the whole safeguard and duplicates start slipping through again.
The deeper fix, and the one most teams skip because it takes more upfront design, is state-based processing rather than raw assignment. Instead of writing whatever status a single event claims, update the resource to reflect its current authoritative state. That's the difference between a delayed intermediate event silently overwriting a terminal decision and that same event getting checked against reality first. Treat the webhook as a signal that something happened, not as the source of truth about what's true right now. Use it to trigger a call back to the system of record, fetch the current state, and act on that. Get this part right and two problems collapse into one fix: ordering sensitivity drops, and idempotency gets a lot simpler, because acting on current state rather than event payload makes most stale-event problems disappear on their own.
For the handful of sequences where order genuinely can't be fudged, payloads need revision numbers or timestamps so a consumer can detect a stale event and defer or drop it outright. And when strict ordering really is non-negotiable, webhooks are the wrong tool, full stop. Event streaming platforms, cursor-based polling, or batched sequential delivery are built for ordered consumption in a way HTTP callbacks simply aren't. Fighting that limitation with more code costs more than switching tools, every time.
Observability, dead-letter queues, and the operational discipline of failure recovery
Every webhook needs to be logged in full, payload and headers, at the moment it's received. Skip this and an incident investigation means trying to reproduce conditions that already came and went, which often just isn't possible.
Good observability means being able to search by any field in the payload, replay failed events in bulk, and route repeated failures automatically to a dead-letter queue for someone to look at by hand. That's the difference between a recovery that takes minutes and one that eats an afternoon.
Dead-letter queues aren't a rare-event fallback, either. In any system built on at-least-once delivery with retry logic, the dead-letter queue is an expected part of normal operations, not a rare-event fallback. It has to be watched and drained on a schedule, not left to pile up until someone stumbles across it.
Replay capability should be built deliberately, ahead of time, not improvised in the middle of an incident. A well-designed replay endpoint means a downstream outage doesn't translate into permanently lost events. Whatever came in during the outage can be pushed through again once things recover. Webhook logs feeding into a SIEM add a layer no single event can provide on its own: patterns that would otherwise go unnoticed in individual events only become visible once correlated against other data rather than viewed one failed request at a time. Certificate expiry deserves its own dedicated alert too, because expiry failures can go unnoticed at the application level. A gap in the audit log may be the first sign anything is wrong.
What this means for SMBs running security integrations without a dedicated security team
The tools most SMBs lean on, identity providers, endpoint management platforms, compliance systems, are precisely the webhook-heavy setups where every failure mode above is live and waiting. For a smaller company, the exact plumbing connecting the tools they already use every day makes this practical rather than theoretical.
Here's the uncomfortable part: signature verification, idempotency logic, dead-letter queue monitoring, certificate rotation alerts, SIEM correlation, each one is individually a reasonable engineering decision, the kind any competent developer would make given time. Collectively, they demand sustained, ongoing attention from someone who understands the mechanics and keeps checking on them, week after week. Fewer than 30% of webhook integrations verify signatures in production, and that gap doesn't exist because teams decided it wasn't worth the effort. It exists because no one was assigned to confirm it got done and stayed done.
For an SMB without a dedicated security engineer, building this in-house is the wrong bet, and it's not close. Whether a generalist developer can wire up HMAC verification matters far less than whether the security platform already being paid for handles this by default. Signature verification, retry logic, deduplication, and logging belong built into the platform itself, not left as configuration tasks handed to whichever generalist has time that week.
An integrated platform that handles device management, endpoint security, identity protection, and compliance automation from one place also cuts down the sheer number of webhook integrations that need individual securing and watching. Fewer integration points mean fewer attack surfaces, fewer ordering headaches, and fewer dead-letter queues sitting unattended. The signal worth looking for in a platform is deployment measured in weeks rather than months, enforcement that runs continuously instead of depending on someone remembering a configuration step, and observability that doesn't require a security engineer on staff just to read it. That's what turns webhook reliability from a per-integration gamble into something the platform simply guarantees.
Sources
- hookdeck.com
- Billing Webhook Reliability: Idempotency and Retries | Lago
- Webhook Delivery Guarantees | Svix Resources
- Webhook Best Practices: Idempotency and Event Ordering
- At-Least-Once vs. Exactly-Once Webhook Delivery Guarantees
- How Reliable Are Webhooks? | Svix Resources
- carrierintegrationsoftware.com
- realtyapi.io


