Skip to content

[Security] Script injection and wildcard permissions in need-triage-label.yml #1601

Open

Description

@mertcano

Problem

In .github/workflows/need-triage-label.yml, the untrusted input ${{ github.event.issue.user.login }} was previously interpolated directly into an inline bash run: block, creating a potential script injection vector. Additionally, matching was unanchored and job permissions were not explicitly constrained to least privilege.

Proposed Fix

  • Pass github.event.issue.user.login securely through env: OPENER_LOGIN.
  • Enforce exact line match via grep -qxF "$OPENER_LOGIN".
  • Declare explicit job-level permissions (contents: read, issues: write).
  • Pin workflow action dependencies to immutable commit SHAs.

I have a patch ready with local verification tests. Could you please assign this issue to me?

Activity

  1. added
    need-triage
    on Oct 1, 2026
  2. feafel commented on Oct 11, 2026

    @feafel

    Hi, I've prepared a fix for this issue in PR (will open shortly). The fix:

    1. Passes ${{ github.event.issue.user.login }} securely through env: OPENER_LOGIN
    2. Uses grep -qxF "$OPENER_LOGIN" for exact whole-line fixed-string matching (no regex)
    3. Adds explicit job-level permissions (contents: read, issues: write)
    4. Keeps existing action SHAs pinned

    Could you please assign this issue to me so I can submit the PR?

  3. mertcano commented on Oct 11, 2026

    @mertcano
    Author

    Hi @feafel,

    As noted in the description and reference history above, I already reported this issue and submitted the complete fix via PR #1600 a week ago, which implements these exact changes and includes verification.

    PR #1600 is already open and awaiting review from maintainers, so PR #1604 appears to be a duplicate.

    @maintainers — PR #1600 is ready for review whenever you have bandwidth. Thanks!

  4. feafel commented on Oct 15, 2026

    @feafel

    Quick status note for maintainers (and a correction to the comment above):

    There is currently no open PR for this issue — both attempts were auto-closed by the workflow bot:

    So the issue is still unaddressed on main: need-triage-label.yml still interpolates github.event.issue.title / author-controlled text into gh invocations in a pull_request_target-adjacent workflow and still grants the job write-scoped permissions without an explicit permissions: block.

    What I need to proceed: assignment to this issue (per CONTRIBUTING.md). Once assigned I will reopen PR #1604 — the branch with the fix is ready: env:-sanitized inputs (OPENER_LOGIN etc.), grep -qxF exact-match CODEOWNERS check, and permissions: contents: read / issues: write at job level. I will also address the commit-signature check so the "Verify commit signatures" job passes.

    If @mertcano prefers to take it, happy to step back provided someone with a live (non-closed) PR can actually land the fix — the security finding has now been public for 10 days with two bot-closed PRs and no assignee.

  5. mertcano commented on Oct 15, 2026

    @mertcano
    Author

    Could you please assign this issue to me so I can reopen and properly submit the fix?

  6. romac commented on Nov 9, 2026

    @romac
    Contributor

    Thanks for the report. We are looking into this.

  7. added
    ci
    and removed
    need-triage
    on Nov 9, 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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions