🪝

Webhook Debugger

Parse raw webhook requests, recompute provider signatures and build replay commands.
Webhook 📂 Developer 👤 ToolCMS 🏷️ v1.5.0 ⚙️ clipboard
Webhook · 请求检查

把收到的回调拆成可核对的事实

粘贴原始 HTTP 请求或请求体,解析方法、路径、查询、头部与负载,校验 GitHub、Stripe、Shopify、Slack、Twilio 与微信的签名,生成重放命令。全部在浏览器内完成,密钥不上传。

签名排障清单

交付前逐条过
  • 先确认签名是对“原始字节”计算,不是对格式化后的 JSON;任何重新序列化都会改变签名结果。
  • 时间戳容差通常 5 分钟,服务器与网关时钟漂移是最常见的“签名正确但被拒”。
  • 签名字符串的拼接顺序按平台文档逐字核对:Stripe 是 `t.payload`,Square 是 `url + body`,GitHub 是 `sha256=HMAC(body)`。
  • 多签名头(`v1=...,v1=...`)要全部尝试,轮换期新旧密钥会同时有效。
  • 请求体经过反向代理压缩或改写时签名必然失败,抓包对比原始长度最直接。
  • 重放攻击靠事件 ID 去重,不要只依赖时间戳;同一事件 ID 只处理一次。
  • 本地复现时把请求头按原样带入,缺 `content-type` 或大小写不一致都会影响部分平台的签名口径。
  • 排查顺序:字节一致 → 密钥正确 → 拼接顺序 → 编码(hex/base64)→ 时间戳,逐层排除比盲改快。

原始请求

请求行 + 头部 + 空行 + 请求体

只填 JSON 也可以:解析器会按 POST + application/json 处理。

签名校验

未校验

重放命令

改目标地址后复制
解析后生成可复制的重放命令。

两次请求对比

定位改了什么导致签名挂

先解析一条基线请求,再解析下一条,点对比即可看到头部与请求体字段的变化。

还没有基线,解析两条请求后再对比。

签名矩阵

同一请求 × 各平台口径

用同一密钥与请求体,把各平台签名口径并排算一遍,看哪一家的头对得上。缺少时间戳或表单字段的会直接标注。

平台期望签名请求头结论
点“计算签名矩阵”后显示

并发签名压测

未运行

对当前请求体连续做 50 次 HMAC-SHA256,测本机吞吐。用于判断验签是否值得加缓存或换原生实现。

尚未采样。分五轮各 50 次,输出 p50 / p95 与吞吐。

服务端验证代码

按服务商生成

验签必须使用原始请求体字节,框架若先解析 JSON 再签名,空格与键序都会变。下面按当前服务商生成最小可用的服务端校验片段,密钥一律以环境变量占位,不写进代码。

点“生成代码”后显示。

签名方案对照

口径差异
服务商签名基准串编码时间戳
GitHub原始请求体sha256= 十六进制无(靠 delivery ID 去重)
Stripe时间戳 + '.' + 原始请求体t=,v1= 十六进制有,默认 300 秒
Shopify原始请求体base64无
Slackv0:时间戳:原始请求体v0= 十六进制有,5 分钟
Square回调 URL + 原始请求体base64无
TwilioURL + 按名排序的字段名值拼接base64无
微信token、timestamp、nonce 排序拼接SHA-1 十六进制无
Discord时间戳 + 原始请求体Ed25519有

负载字段提取

点路径取值

按点路径读取 JSON 字段,支持数组下标,例如 data.object.amount 或 items.0.id。用于核对金额、事件 ID 等关键字段。

解析请求后输入路径再提取。

请求概览

等待解析
方法-
请求体0 B
头部0
查询参数0

头部

已按名称排序
名称值
解析后显示

请求体

等待解析
解析后显示格式化后的请求体。

签名基准串分步

未拆解

验签失败八成是基准串拼错。这里把所选服务商的基准串按步骤摊开,标出每段的字节数,最后给出完整拼接顺序。

步骤内容字节
解析请求后拆解

负载必填字段

未校验

按服务商的回调契约检查 JSON 关键路径。缺字段不一定验签失败,但下游处理会拿到 undefined。

字段状态说明
解析请求后校验

检查清单

0 条
解析后做签名、格式与重复投递检查。

本次会话记录

0 条
时间方法事件签名
解析的请求会记录在这里,仅保存在当前页面

How to Use

📖 What it does

Webhook integration fails in three familiar ways: the signature never verifies, the same event is processed twice, and the only trace in the log is a bare 400 with no idea what the request looked like.

This page accepts a raw HTTP request, request line, headers, blank line and body, and pulls it apart: method, path, query string, headers, byte size, JSON structure, event type and event id. Authorization, cookie and signature headers are masked automatically.

It also recomputes signatures for six providers with the secret you supply and builds a replay command you can paste into a terminal. There is no public receive URL, because the platform hosts no long-running server; for live traffic, tunnel to a local listener with ngrok or Cloudflare Tunnel.

✨ Features

  • Parse a raw HTTP request including folded header continuation lines, with a fallback to POST plus application/json when only a JSON body is pasted.
  • Detect event type across type, event, event_type, eventType, topic and action, and event id across id, event_id, eventId, delivery, webhook_id and notification_id.
  • Mask Authorization, Cookie, Signature, Secret and Token headers to a few visible characters so screenshots are safe to share.
  • Recompute signatures for GitHub (HMAC-SHA256 hex), Stripe (t= and v1= over timestamp and body with a tolerance), Shopify (Base64), Slack (v0:timestamp:body), Twilio (HMAC-SHA1 over URL and sorted parameters) and WeChat (sorted token, timestamp and nonce with SHA-1).
  • Build curl, fetch and httpie replay commands that drop Host and Content-Length, keep the body byte-exact with --data-raw, and merge the target query string with the original one.
  • A checklist for missing Content-Type, JSON that fails to parse, a non-POST method, oversized bodies, missing event keys, tokens in the query string, signature mismatch, duplicate event ids and missing signature headers.
  • An A to D grade that accumulates the checklist deductions and explains each one.
  • A session table of parsed requests with time, method, event and verdict, exportable as CSV or JSON and clearable in one click.
  • Square (HMAC-SHA256 base64 over URL plus body) and Discord (Ed25519) signatures are verified in the browser.
  • The provider is detected from the request headers, so a pasted GitHub, Stripe or Square callback needs no manual switching.
  • A two-request comparison lists added, missing and changed headers and body fields, which usually points straight at the byte that broke the signature.
  • A signature matrix computes GitHub, Shopify, Square, Slack, Stripe and Twilio schemes for the same request and key, flagging a missing timestamp or form field instead of reporting a mismatch.
  • A throughput test runs fifty HMAC-SHA256 operations and reports total time and operations per second.
  • Export .http restores the parsed request to the text format used by the JetBrains and VS Code REST clients.
  • The throughput test now runs five rounds of fifty and reports p50, p95 and operations per second, which is enough to decide whether verification needs a cache.
  • A JSON path extractor reads body fields by dot path, including array indexes.
  • An export masking switch replaces signature, Authorization and Cookie header values with *** in replay commands and .http files.
  • Server-side verification snippets are generated for Python, Node and PHP per provider, using the raw request body and a constant-time comparison.
  • Header lint flags duplicate headers, underscore names, a Content-Length that disagrees with the body, Transfer-Encoding alongside Content-Length and a missing Host.
  • The replay window is checked from Stripe, Slack and Discord timestamps, so an expired request is called out before it reaches production.
  • A signature scheme table lines up the signing base string, encoding and timestamp rule for eight providers.
  • A step-by-step signing base string breaks the canonical string into steps with byte counts and ordering, the first place to look when verification fails.
  • A payload field check validates the JSON paths each provider promises and recommends a 400 when a required field is missing.
  • The checklist now flags a missing idempotency key, retry counters and Retry-After, so retry storms and duplicate delivery surface early.

🚀 How to use it

  1. Paste the whole raw request from the gateway or framework log into the Raw request box, request line and headers included.
  2. Press Parse and confirm the method, path, Content-Type and event type match what you expect.
  3. Choose the provider in the signature panel and enter the signing secret; Stripe and Slack timestamps are read from the headers for you.
  4. Press Compute to see the expected signature, then Verify to compare it with the header the request carried.
  5. Use the replay command against your own debug endpoint to reproduce locally, and export the CSV when the session should be kept.

⚠️ Before you rely on it

  • There is no public receive URL. Point ngrok, Cloudflare Tunnel or your own proxy at a local listener for real callbacks.
  • Signing secrets are held in memory only and are dropped on refresh, but test-mode secrets are still the better habit.
  • Stripe and Slack signatures include timestamps, so stale requests are reported as expired rather than mismatched.
  • Twilio signs the full URL plus sorted form parameters, so a proxy that rewrites the URL will break recomputation.
  • WeChat signs only sorted token, timestamp and nonce; the event body still has to be parsed separately.
  • The parser tolerates folded headers but ignores HTTP/2 pseudo headers and multipart file parts.

Related

⏫︎