Skip to content

Harden pull-request webhook deliveries on GitLab, Gitea and Bitbucket #16097

Backlog

Description

@ChiragAgg5k

Summary

Harden how VCS webhook deliveries are trusted on providers whose webhook secret is instance-wide: GitLab, Gitea/Gogs/Forgejo and Bitbucket.

The shared deployment path checks that a push delivery's commit is the provider's current branch head before it builds. That check does not run for pull-request deliveries. Pull-request deliveries never create a deployment, so no build or live deployment is affected. They can still lead to a PR comment and a commit status being written for the repository named in the delivery.

Tracks code scanning alert 4980, dismissed as hardening tracked here.

Proposed hardening

  1. Compute the external flag on the server, from the provider's own pull-request record, instead of trusting the parsed delivery body.
  2. In the GitLab, Gitea and Bitbucket adapters, treat a delivery that omits repository identifiers as external rather than internal.
  3. Extend the branch-head check to pull-request deliveries, so every delivery shape enforces the same invariant.
  4. Scope the repository lookup by the owning project or installation, so a delivery cannot name another project's repository.
  5. Add a regression test on the shared deployment trait that covers both delivery shapes.

Context

  • Push-delivery verification against the branch head is already in place.
  • GitHub deliveries are signed per installation, so the gap applies only to the providers listed above.

Activity

  1. added
    product / vcs
    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

    product / vcs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions