Skip to content

Pass label/branch-name values to shell via env, not template interpolation - #96

Closed
VibratingKoala wants to merge 1 commit into
mainfrom
i95-fix-label-shell-injection
Closed

VibratingKoala wants to merge 1 commit into
mainfrom
i95-fix-label-shell-injection

Conversation

@VibratingKoala

@VibratingKoala VibratingKoala commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #95.

start-pull-request.yml interpolated ${{ env.LABELS }}, ${{ env.ASSIGNEES }}, ${{ env.NEW_BRANCH_NAME }} and ${{ github.event.issue.number }} directly into run: script text. GitHub Actions substitutes ${{ }} as text before the shell runs, so a value containing $() or backticks would execute on the runner — in a job holding contents/issues/pull-requests: write + id-token: write.

Not currently exploitable (every label/branch-name producer today is a hardcoded literal or numeric — see the issue for the scan panel's reasoning), but the safety was external to this file rather than built into it.

Change

Every run: step now references the already-exported $GITHUB_ENV shell variables directly, matching the pattern already used elsewhere in the file (:47-49, :66-68). No ${{ env.* }} interpolation remains in any run: step.

${{ github.event.repository.default_branch }} on --base is left as template interpolation — that's repo config, not user-influenceable data, so it's outside the injection class this issue describes.

Testing

Workflow-only change, no app code touched — app/ doesn't exist on main yet (POC is still on the unmerged i68-handbook-poc branch), so the pnpm test/pnpm build gates don't apply here.

…ation

start-pull-request.yml interpolated ${{ env.LABELS }}, ${{ env.ASSIGNEES }},
${{ env.NEW_BRANCH_NAME }} and ${{ github.event.issue.number }} directly into
run: script text. GitHub Actions substitutes these as text before the shell
runs, so a value containing $() or backticks would execute on the runner in a
job holding contents/issues/pull-requests write + id-token write. Not
currently exploitable (every label/branch-name producer today is a hardcoded
literal or numeric), but the safety was external to this file rather than
built into it.

Switched every run: step to reference the already-exported $GITHUB_ENV shell
variables directly instead, matching the pattern the file already used at
:47-49/:66-68.

Fixes #95
@VibratingKoala
VibratingKoala force-pushed the i95-fix-label-shell-injection branch from e061aee to 0c2d652 Compare August 24, 2026 08:36
@VibratingKoala VibratingKoala self-assigned this Aug 24, 2026
@VibratingKoala VibratingKoala added the ci-testing Enable a GitHub Action for unit testing on a pull request. label Aug 24, 2026
@VibratingKoala

Copy link
Copy Markdown
Contributor Author

Superseding this with #97 (the auto-generated PR for #95) — moved the fix there per request.

@VibratingKoala
VibratingKoala deleted the i95-fix-label-shell-injection branch August 24, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-testing Enable a GitHub Action for unit testing on a pull request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modify start-pull-request.yml to pass label values through env instead of inline interpolation

1 participant