Skip to content

ci: fix expression injection in notify-on-review-wanted workflow #63720

Open
XananasX7 wants to merge 2 commits into
nodejs:mainfrom
XananasX7:fix/workflow-expression-injection-notify
Open

ci: fix expression injection in notify-on-review-wanted workflow #63720
XananasX7 wants to merge 2 commits into
nodejs:mainfrom
XananasX7:fix/workflow-expression-injection-notify

Conversation

@XananasX7
Copy link
Copy Markdown

The .github/workflows/notify-on-review-wanted.yml workflow injects GitHub Actions expressions directly into a shell run step. This is flagged by zizmor/actionlint and violates GitHub's security hardening guidelines. Fix: use env vars instead of inline expressions.

The workflow used GitHub Actions expressions directly inside shell run steps:

    if [[ -n "${{ github.event.pull_request.number }}" ]]; then
      number="${{ github.event.pull_request.number }}"
      number="${{ github.event.issue.number }}"

Fix: move expressions into env vars, reference env vars in shell.

Ref: https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions#understanding-the-risk-of-script-injections

Signed-off-by: El Mehdi Abenhazou <mehdiananas007@gmail.com>
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/actions

@nodejs-github-bot nodejs-github-bot added the meta Issues and PRs related to the general management of the project. label Jun 3, 2026
@Renegade334
Copy link
Copy Markdown
Member

These are non-user-controlled numeric variables, so shell escaping is not a concern here? We already pass string variables appropriately.

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

Labels

meta Issues and PRs related to the general management of the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants