Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Signature Verification

Direct answer

Cryptographic validation that webhook bytes were signed by a trusted producer, commonly with HMAC or asymmetric signatures and replay controls.

When to use this

Use it when designing, operating or troubleshooting the webhook boundary around Signature Verification. Keep producer event, delivery identity, source verification, acknowledgement, durable processing and downstream state separate.

First 30 seconds

1. Verify HMAC signatures over the raw body.

2. Compare in constant time.

3. Check timestamp to prevent replay.

4. Use the exact raw bytes (no re-serialisation).

5. Reject mismatches.

Operational verification

raw body + secret → HMAC → compare with header

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
webhook delivery automation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformwebhook delivery automation · Automation → Webhooks owns generic Signature Verification semantics. Broader event orchestration remains in Event-Driven Automation, and provider/target-specific behavior stays in the owning platform Domain. · OpenSSL
Key commandopenssl dgst -sha256 -verify <public-key.pem> -signature <signature.bin> <payload.bin>
Scope / prerequisiteUse it when designing, operating or troubleshooting the webhook boundary around Signature Verification. Keep producer e…
Reference · 1
What next?3 suggested next steps
Catalog command links1
Evidence1
On this pageJump to a specific section
Automation command reference

Primary Commands

Configuration and operational commands for this Topic.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

raw request bytes + signed metadata → key/secret selection → signature computation/verification → freshness/replay check → payload parse → processing

Healthy evidence: raw-byte verification, freshness checks and key rotation are deterministic and invalid signatures are rejected before side effects.

Step 2 Command read-back and what it shows Verify boundary

openssl dgst -sha256 -verify <public-key.pem> -signature <signature.bin> <payload.bin> is the bounded verification surface selected for Webhooks → Signature Verification. A known-good result is the signature over the exact received bytes validates with the expected active key/algorithm, freshness/replay checks pass and only then is the event routed to the intended handler. Treat missing/invalid signature, wrong key/algorithm/canonicalization, stale timestamp/replayed nonce or processing that occurs before authenticity/freshness is established as broken/suspicious. The OpenSSL signature check shows cryptographic validity for the supplied bytes/key/signature, but it does not show sender authorization beyond key possession, freshness or semantic safety of the event.

Step 3 Failure modes and next checks Narrow the fault

Suspicious evidence: verification after parsing/re-serialization, no replay window, timing-unsafe compare, secret mismatch during rotation or invalid event processed anyway.

Step 4 Observation-driven branch and next-check logic Narrow the fault

For a failing Webhooks → Signature Verification case, freeze scope first: target/object, desired revision or request, and failure time. Inspect openssl dgst -sha256 -verify <public-key.pem> -signature <signature.bin> <payload.bin>. Branch on evidence rather than labels: if signature is missing/malformed, reject before handler execution; if signature mismatch, compare raw bytes, algorithm, key version and canonicalization; if signature verifies but timestamp/nonce is stale/replayed, reject on freshness before processing event semantics.

Step 5 Common mistakes Narrow the fault
  • Comparing signatures with normal string equality (timing attacks).
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Signature matches ≠ event fresh; captured valid requests can be replayed without timestamp/nonce controls.
  • Parsed payload reserialized ≠ original signed bytes; whitespace/order changes can invalidate verification.
  • Shared HMAC secret ≠ public attribution; both holder and verifier can compute the same MAC.
  • Valid signature ≠ event authorized for every downstream action; consumer policy still applies.
Key checks
  • python3 -c "import hmac,hashlib;print(hmac.new(b'secret',open('body','rb').read(),hashlib.sha256).hexdigest())" — compute HMAC
  • Constant-time comparison — timing safety
  • Timestamp tolerance (replay window) — replay protection
ReferenceHow it works1 section · depth on demand

How it works

In Webhooks → Signature Verification, effective state is split across the raw request bytes, sender identity/key, signature algorithm/header format, freshness/replay fields and secret/public-key version used to authenticate an inbound webhook. Signature verification reconstructs the exact signed payload according to provider rules and compares the received signature using a shared secret or public key before the event is trusted or dispatched. TLS transport, secret rotation, clock skew, proxy body transformations, encoding and replay storage are separate things to check. This matters because valid TLS does not authenticate the webhook payload itself, and recomputing a signature over parsed/re-serialized JSON can fail even when the original raw-body signature was valid.

ReferenceImportant terms & boundaries2 sections · depth on demand

What this shows and what it does not

A valid signature shows integrity/authenticity under the configured key material, but it does not show freshness, authorization or downstream success.

In depth

Signature verification checks an HMAC of the webhook body, computed with a shared secret, against the signature header the producer sent. A match proves the payload came from someone who knows the secret and was not changed in transit.

import hmac, hashlib
def valid(raw_body: bytes, header: str, secret: bytes) -> bool:
    expected = "sha256=" + hmac.new(secret, raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, header)
# GitHub sends the header X-Hub-Signature-256
PitfallEffect
Verifying parsed/re-serialised JSONSignature never matches
Using == instead of constant-time compareTiming attack risk
Ignoring timestamp headerReplay possible
Wrong secret per environmentAll deliveries rejected
Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docwebhook delivery automation current

Authoritative/upstream documentation reviewed for bounded claims in Webhooks > Signature Verification. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.github.com/en/webhooks/using-webhooks/validating-webhook-deliveries · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
webhook signature verificationhmac webhooksigned webhookwebhook replay protection
Embedded reference data

Quick lookup tables

Signature Verification webhook boundary map

Fast request/delivery, trust, processing and verification boundaries for Signature Verification.

BoundaryHealthy evidenceSuspicious evidence
Source / deliveryEvent, subscription, delivery ID and attempt metadata are attributableMissing source event, stale subscription, wrong callback or delivery history gap
Trust / acknowledgementAuth/signature and schema checks occur before safe acknowledgementUnverified payload, slow handler, 2xx before durable receipt or replay weakness
Processing / proofDurable dedupe/worker evidence matches downstream target stateDuplicate side effect, worker failure hidden by 2xx or no target reconciliation
TroubleshootingFirst failed boundary is preserved, changed minimally and retestedBlind retries, credential rotation, replay or payload edits before evidence is captured
Confirmation

Confirm action

Continue?