Skip to content

Fix gh-aw shell-injection warnings and update generated locks#8458

Merged
Evangelink merged 1 commit into
mainfrom
dev/amauryleve/fix-gh-aw-shell-injection-warnings
May 21, 2026
Merged

Fix gh-aw shell-injection warnings and update generated locks#8458
Evangelink merged 1 commit into
mainfrom
dev/amauryleve/fix-gh-aw-shell-injection-warnings

Conversation

@Evangelink
Copy link
Copy Markdown
Member

What

Fix gh aw compile --strict shell-injection warnings on 3 agentic workflows and update generated lock files.

Source workflow changes (3 files)

  • .github/workflows/build-failure-analysis.md
  • .github/workflows/build-failure-analysis-command.md
  • .github/workflows/issue-arborist.md

Each one moves ${{ ... }} expressions out of run: scripts into step-level env: blocks, satisfying the strict-mode shell-injection check. The expressions covered are: steps.find-binlog.outputs.path, github.repository, inputs.pr-number, github.event.issue.number, steps.build.outcome, github.workspace, and the resolved PR head SHA fallback chain.

Generated changes (regenerated outputs)

  • .github/aw/actions-lock.json — gh-aw-actions/setup v0.72.1 → v0.74.8; new firewall image SHAs (0.25.41, 0.25.46, 0.25.49)
  • .github/workflows/agentics-maintenance.yml and ~18 other .lock.yml files — pure regeneration from gh aw compile after the runtime version bump; no source .md edits.
  • .github/workflows/msbuild-quality-review.lock.yml — also regenerated; supersedes the partial regen from Regenerate stale msbuild-quality-review.lock.yml #8455 (now consistently at v0.74.8).

Remaining gh aw compile --strict output

Only one informational warning is left and is intentionally deferred to a follow-up PR:

Detected 6 slash_command entries; 6 are not using centralized routing. Consider setting on.slash_command.strategy: centralized to reduce duplicate triggers and route through agentic_commands.yml.

How to verify

gh aw compile --strict

should emit 0 error(s) and only the slash-command centralization suggestion above.

Source workflow changes (3 files):
- .github/workflows/build-failure-analysis.md
- .github/workflows/build-failure-analysis-command.md
- .github/workflows/issue-arborist.md

Each moves ${{ ... }} expressions out of run: scripts into step-level
env: blocks to satisfy gh aw compile --strict shell-injection warnings
(e.g. steps.find-binlog.outputs.path, github.repository, inputs.pr-number,
github.event.issue.number, steps.build.outcome, github.workspace).

All other .lock.yml files and .github/aw/actions-lock.json /
agentics-maintenance.yml are regenerated outputs from running
gh aw compile after the gh-aw runtime bumped (gh-aw-actions/setup
v0.72.1 -> v0.74.8, new firewall image SHAs). They contain no
behavioral source changes.

The only remaining gh aw compile --strict warning is the informational
suggestion to set on.slash_command.strategy: centralized on 6 workflows;
this is intentionally deferred to a follow-up PR.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 21, 2026 11:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates agentic workflow sources and regenerates gh-aw lock artifacts to eliminate gh aw compile --strict shell-injection warnings and to align all generated workflows/locks with gh-aw v0.74.8.

Changes:

  • Move ${{ ... }} GitHub expressions out of run: scripts into step-level env: in the 3 affected agentic workflow sources.
  • Regenerate .lock.yml workflows and update .github/aw/actions-lock.json to reflect gh-aw v0.74.8 and updated pinned action/container SHAs.
  • Refresh generated agentics-maintenance.yml content (including the newly generated forecast maintenance operation).
Show a summary per file
File Description
.github/workflows/build-failure-analysis.md Moves step outputs/context expressions from run: into env: for strict-mode shell-injection compliance.
.github/workflows/build-failure-analysis-command.md Same strict-mode fix as above for the slash-command variant workflow.
.github/workflows/issue-arborist.md Moves github.repository expression out of the curl run: script into step env:.
.github/workflows/repo-historian.lock.yml Regenerated lock workflow with updated gh-aw version, pinned actions/containers, and updated generated harness snippets.
.github/workflows/issue-arborist.lock.yml Regenerated lock workflow with updated gh-aw version, pinned actions/containers, and generated env-expression handling.
.github/workflows/msbuild-quality-review.lock.yml Regenerated lock workflow for gh-aw v0.74.8; includes updated pinned dependencies and regenerated job steps.
.github/workflows/daily-malicious-code-scan.lock.yml Regenerated lock workflow for gh-aw v0.74.8; updates pinned actions/containers (incl. CodeQL upload-sarif).
.github/workflows/agentics-maintenance.yml Regenerated maintenance workflow for gh-aw v0.74.8; includes the new generated forecast operation path.
.github/aw/actions-lock.json Updates pinned action/container entries to match regenerated workflows (gh-aw-actions/setup v0.74.8, updated SHAs/images).

Copilot's findings

  • Files reviewed: 19/26 changed files
  • Comments generated: 0

@Evangelink Evangelink merged commit 5fb0f8a into main May 21, 2026
22 of 23 checks passed
@Evangelink Evangelink deleted the dev/amauryleve/fix-gh-aw-shell-injection-warnings branch May 21, 2026 11:26
Copy link
Copy Markdown
Member Author

@Evangelink Evangelink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 21/21 dimensions clean — no findings.

This PR is a textbook-correct security fix for shell injection vulnerabilities in GitHub Actions workflows. The changes follow the industry-standard pattern of moving GitHub Actions expressions (${{ ... }}) from run: script blocks into step-level env: blocks, preventing potential injection attacks through repository names or issue numbers.

What was fixed:

  • 3 workflow source files (.md) now use environment variables instead of inline expressions
  • 23 generated lock files updated after gh-aw runtime bump (v0.72.1 → v0.74.8)

Security impact: The vulnerable pattern allowed expressions like ${{ github.repository }} to be interpolated directly into shell commands. If an attacker could control the repository name (e.g., via a fork or malicious issue), they could potentially inject shell metacharacters. The new pattern evaluates expressions in the GitHub Actions runtime before the shell sees them, eliminating this attack vector.

Code quality: The transformation is applied consistently across all three affected workflows with proper variable naming (GH_AW_* prefix) and complete coverage of all vulnerable expressions.

The generated lock file changes are mechanical and correct — they reflect the runtime version bump and updated firewall image SHAs.

Post-merge note: This PR is already merged. This review confirms the changes are correct and complete.

Generated by Expert Code Review (on open) for issue #8458 · ● 3.8M

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants