IOSOR Learn
Validating DLR Webhook Signature and Replay Protection
Verify webhook authenticity and idempotency across carriers before routing production traffic, then compare partner DLR reliability in the Decision Brief.
Lead Telecom & Routing Architect · Lausanne, CH
Engineers must confirm every DLR webhook carries a valid HMAC signature and a monotonically increasing nonce or timestamp to reject replays before accepting delivery receipts into production pipelines.
Signature Algorithm and Key Rotation
Carriers typically sign payloads with HMAC-SHA256 using a shared secret provisioned during onboarding. Validate the signature header against the raw request body before any JSON parsing. Rotate secrets quarterly via the carrier portal; maintain a two-key overlap window so in-flight webhooks signed with the old key still verify. Log verification failures with correlation IDs for rapid triage.
Replay Window and Nonce Management
Enforce a strict replay window — typically 5 minutes — by comparing the carrier timestamp header to server time. Store processed nonces in a fast TTL cache (Redis or in-memory LRU) keyed by message-id plus carrier-id. Reject duplicates with HTTP 409 and increment a replay counter metric. Ensure clock sync via NTP across all webhook ingest nodes to avoid false positives.
Payload Integrity and Canonicalization
Some carriers sign a canonicalized JSON string (sorted keys, no whitespace) while others sign the raw HTTP body. Document the exact canonicalization rule per carrier in your integration spec. Reject payloads where the Content-Type is not application/json or where the body length exceeds the carrier's documented maximum. Parse only after signature and replay checks pass.
Carrier-Specific Header Mapping
Map each carrier's signature header (e.g., X-the rail-Signature, X-the rail-Signature, throughput-Signature) and timestamp/nonce header to a normalized internal schema. Build a carrier-adapter layer so the core verification logic stays carrier-agnostic. Unit-test each adapter with recorded production samples including edge cases: missing headers, malformed timestamps, and signature mismatches.
Observability and Alerting
Emit structured logs for every verification outcome: success, signature failure, replay detection, timestamp skew. Alert on signature failure rate > 0.1% or replay rate > 0.01% over a 5-minute window. Correlate with carrier status pages and DLR latency dashboards. Include carrier, message-id, and verification latency in every log line for downstream debugging.
Start with IOSOR
Compare verified partner routes for DLR webhook reliability, signature compliance, and replay protection in your corridor using the Decision Brief. Cross-reference with Benchmarking Webhook Latency and DLR Reliability Across Routes, Analyzing Carrier Delivery Receipt Reconciliation and Data Gaps, and auditing multi-carrier DLR discrepancy resolution.
IOSOR takeaway
Carriers typically sign payloads with HMAC-SHA256 using a shared secret provisioned during onboarding. Include carrier, message-id, and verification latency in every log line for downstream debugging (/tools/brief · DLR / webhook).
Was this guide helpful?
Related guides
- Auditing A2P Route Failover Consent Evidence Parity
Verify consent evidence, opt-out state, and message classification stay identical across A2P route failover, then compare partner routes with provable parity.
- Auditing A2P Route Sender Number Pool Rotation Consistency
Verify pooled sender rotation preserves per-number reputation isolation, DLR continuity, and consent evidence linkage before scaling A2P volume.
- Vetting A2P Route DLR Reconciliation SLAs and Cost Bands
Compare A2P route partners on DLR reconciliation guarantees, webhook replay windows, and per-message cost bands before committing volume. Trigger the Decision Brief partner comparison.












