You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
build-release-task.yml and the Publisher Stubs Interpolate the Branch Into a run: Script #1529
.github/workflows/build-release-task.yml's release-asset delete step interpolates ${{ inputs.branch }} straight into its run: script, inside the double-quoted --jq filter:
if ! ids=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/${{ github.run_id }}/artifacts" --paginate \--jq ".artifacts[] | select(.name | startswith(\"release-asset-${{ inputs.branch }}-\")) | .id"); then
An expression is substituted into the script text before bash parses it, so a branch carrying shell syntax becomes code rather than data. Git accepts ref names such as a$(id) or one containing a backtick or ", so a branch named that way runs in a job whose environment holds the GitHub token. The documented publisher stubs in docs/reusable-workflows.md, the NuGet and PyPI consume-then-delete steps, use the same shape with ${{ github.ref_name }}.
Constructed example: a branch named x$(touch /tmp/pwned) reaching this step on a non-smoke publish runs touch before gh is invoked.
Why it is not urgent
The step runs only on a non-smoke publish, which someone with write access starts, and they can already edit the workflow, so it crosses no permission boundary. D2.3 also limits a publish to main and develop. It surfaced while reviewing the fix for a related log-line finding on #1526, and is the recognized Actions anti-pattern of an expression inside run: rather than a reachable exploit.
Possible fix
Pass the value through env: and reference it as a shell variable, as the rest of the task already does, for example BRANCH: ${{ inputs.branch }} and startswith(\"release-asset-\" + env.BRANCH + \"-\") or a --arg to jq, in the task and in both documented stubs.
Activity
Refuse a Branch Git Would Not Name at the Release Gate, and Stop Prin…
Build the PyPI Version From the Release Tag, and Hand the build-pypi …
Pass the Branch to Every run: Script Through env, Never as an Express…
Pass the Branch to Every run: Script Through env, Never as an Express…