You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SECURITY] Webhook replay protection: delivery-ID dedupe and timestamped signatures #194
Webhook HMAC signatures (X-Hub-Signature-256, X-Webhook-Signature) cover only the body. There's no timestamp, nonce or delivery-ID check, so anyone who captures one signed request (from a proxy log, a misconfigured load balancer or a leaked HAR file) can replay it indefinitely:
/webhook/manual and /webhook/github re-enqueue the same incident each time, running the agent with the org's credentials and LLM budget.
GitHub: store X-GitHub-Delivery IDs per org for 24h and return 200 {"status": "duplicate"} on repeats. GitLab sends X-Gitlab-Event-UUID and Bitbucket sends X-Request-UUID, so do the same for those.
Manual and custom senders: support an optional X-Webhook-Timestamp header, sign "{timestamp}.{body}" (the Stripe/Slack scheme), reject anything older than 5 minutes, and remember the signature for the window. Make it required when WEBHOOK_REQUIRE_TIMESTAMP=true.
Document the signing format in docs/API_REFERENCE.md, with curl and Python examples.
Tests: replayed GitHub deliveries are ignored; an old timestamp gives 401; a valid timestamped request is accepted once.
Files
api/webhook_auth.py, api/server.py, services/alert_dedupe.py (storage pattern to reuse), docs/API_REFERENCE.md
Activity