Skip to content

[Code scan] Pin privileged pull_request_target action or replace it with first-party API #147

Description

@njzjz

This issue was found by a Codex global scan of the repository at commit 19f9265.

The label-removal workflow runs on pull_request_target, grants pull-requests: write, and invokes a third-party action by a mutable tag:

pull_request_target:
types:
- labeled
jobs:
remove_label:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
if: github.repository_owner == 'deepmodeling' && github.event.label.name == 'Test CUDA'
steps:
- uses: actions-ecosystem/action-remove-labels@v1

This workflow does not check out or execute fork code, so the risk is much narrower than the common pull_request_target anti-pattern. Still, a mutable third-party action in a privileged workflow is a supply-chain risk.

Suggested fix: replace the action with a small gh api / GitHub Script step using the built-in token, or pin actions-ecosystem/action-remove-labels to a reviewed commit SHA instead of @v1.

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

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions