Skip to content

The preview workflow check misses a PR head fetched without git #3815

Open

Description

@dawsontoth

harper preview setup checks a preview workflow for jobs that could run a PR's own code with the preview identity, but it only inspects actions/checkout and shell git commands. A job holding the identity token that gets the PR's code any other way passes clean:

  • gh pr diff "$PR" | git apply
  • curl https://github.com/<repo>/archive/${{ github.event.pull_request.head.sha }}.tar.gz | tar x
  • gh repo clone <repo> -- --branch "$BRANCH"

The check is a heuristic for an administrator's own workflow, and forks are excluded separately, so this affects same-repository PRs only, with the identity's grant limited to that app's previews. A fix could extend the scan to gh and curl, or mark any command naming a PR-head value unsafe.

Review-Deferral: ff0b8d6b4968d3e6 severity=minor category=security

Part of #3042.

🤖 Generated with Claude Code

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

    No labels
    No labels

    Type

    Fields

    Priority

    P3

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions