Skip to content

[bug] GitHub webhook endpoint does not verify x-hub-signature-256 #694

@agarwal-tanmay-work

Description

@agarwal-tanmay-work

Describe the bug

The GitHub webhook handler processes incoming webhook payloads without explicitly
verifying the x-hub-signature-256 header against a shared secret.

If the webhook endpoint is publicly accessible, a forged request could trigger
webhook-driven workflows (e.g. review agents) without originating from GitHub.

To reproduce

  1. Deploy Sourcebot with GitHub webhook support enabled
  2. Send a POST request to the webhook endpoint with a valid-looking GitHub event payload
  3. Omit or modify the x-hub-signature-256 header
  4. Observe that the payload is still parsed and processed

Sourcebot deployment information

Sourcebot version (e.g. v3.0.1):
Not deployment-specific.

This behavior is observable by inspecting the webhook handler logic, where the
request body is parsed and processed without prior verification of the webhook
signature.

Additional information

GitHub recommends validating webhook payloads using the x-hub-signature-256 header
and a shared secret before parsing or processing the request body.

Verifying the raw request body against the webhook secret before JSON parsing
would prevent forged or replayed webhook events.

Happy to open a PR if that’s useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions