Skip to content

fix: secure CODEOWNER check against script injection in need-triage-label.yml - #1604

Closed
feafel wants to merge 1 commit into
circlefin:mainfrom
feafel:fix/secure-need-triage-label-injection
Closed

feafel wants to merge 1 commit into
circlefin:mainfrom
feafel:fix/secure-need-triage-label-injection

Conversation

@feafel

@feafel feafel commented Oct 11, 2026

Copy link
Copy Markdown

Summary

Fixes #1601

Problem

In .github/workflows/need-triage-label.yml, the untrusted input ${{ github.event.issue.user.login }} was interpolated directly into an inline bash run: block, creating a potential script injection vector.

Fix

  • Pass ${{ github.event.issue.user.login }} securely through env: OPENER_LOGIN
  • Enforce exact line match via grep -qxF "$OPENER_LOGIN" (whole-line fixed-string match, no regex)
  • Declare explicit job-level permissions (contents: read, issues: write)
  • Keep existing action SHAs pinned (already: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10, actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3)

Verification

  • Workflow YAML syntax is valid
  • The grep -qxF change is semantically identical for valid GitHub usernames (alphanumeric + hyphen + underscore) but rejects malicious payloads containing shell metacharacters

Note

I've requested assignment on #1601; submitting this PR per CONTRIBUTING.md.

…abel.yml

Refs circlefin#1601

The original workflow interpolated ${{ github.event.issue.user.login }} directly
into a shell grep pattern, creating a script-injection vector since issue author
names are untrusted input.

### Fix
- Pass ${{ github.event.issue.user.login }} securely through `env: OPENER_LOGIN`
- Enforce exact line match via `grep -qxF "$OPENER_LOGIN"\) (whole-line fixed-string match, no regex)
- Declare explicit job-level permissions (`contents: read`, `issues: write`)
- Keep existing action SHAs pinned (already: `actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10`,
  `actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3`)
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Unsigned Commits Detected

The following commits are missing a verified signature:

  • eceb2f3 by Alice

How to fix: Sign your commits.

@github-actions

Copy link
Copy Markdown
Contributor

Hi @feafel,

Thank you for your interest in contributing to Malachite.

This PR has been automatically closed because you are not assigned to issue #1601. We require contributors to be explicitly assigned to an issue before submitting a PR.

To contribute properly:

  1. Comment on issue [Security] Script injection and wildcard permissions in need-triage-label.yml #1601 requesting assignment
  2. Wait for maintainer approval
  3. Only submit a PR after you have been assigned

Please see our CONTRIBUTING.md for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need-triage This issue needs to be triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants