Skip to content

[SECURITY] Webhook replay protection: delivery-ID dedupe and timestamped signatures #194

Backlog

Description

@OkiriGabriel

Problem

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:

Proposed fix

  • 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

  1. added
    enhancement
    security
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementsecurity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions