Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

Comments

ci: fix script injection in outcome job#22

Draft
persimmon16 wants to merge 1 commit intojolt/1.89.0from
fix/ci-script-injection-master
Draft

ci: fix script injection in outcome job#22
persimmon16 wants to merge 1 commit intojolt/1.89.0from
fix/ci-script-injection-master

Conversation

@persimmon16
Copy link

Summary

Remediates a GitHub Actions script injection vulnerability (CWE-78) in the CI workflow's outcome job, identified by Wiz as issue 16f1da6f-ae19-4da7-9122-1f3e33ba5e10 (HIGH severity).

The toJson(needs) expression was interpolated directly into an inline run: script via a single-quoted here-string. Because ${{ }} expressions are evaluated before the shell parser, any single-quote character in a needs output value (e.g., derived from a crafted commit message processed through calculate_matrix) would terminate the quoted string and yield arbitrary shell execution on the runner.

Fix: Move toJson(needs) to an env: block and reference the resulting shell variable. The runner's environment variable API sets the value without shell interpolation, eliminating the injection vector entirely.

Change

- run: jq --exit-status '...' <<< '${{ toJson(needs) }}'
+ env:
+   NEEDS_CONTEXT: ${{ toJson(needs) }}
+ run: jq --exit-status '...' <<< "$NEEDS_CONTEXT"

References

Move toJson(needs) from inline run: expression to env: variable
to prevent shell metacharacter injection via crafted job outputs.

Wiz Issue: 16f1da6f-ae19-4da7-9122-1f3e33ba5e10
@persimmon16 persimmon16 changed the base branch from master to jolt/1.89.0 February 23, 2026 18:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant