Skip to content

False-negative: head_branch variable is not reported as untrusted #734

Description

@jotak

This should be considered untrusted:

    steps:
      - name: extract PR data
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          pr_json=$(gh api "repos/${{ github.repository }}/pulls?state=open&head=${{ github.event.workflow_run.head_repository.owner.login }}:${{ github.event.workflow_run.head_branch }}")
          # ...

As the branch name can be crafted with malicious code/shell. It should be considered untrusted, similarly to github.event.head_commit.message.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions