-
|
As of v1.9.0, the template-injection audit also triggers if an expandable variable is passed to another GitHub action as input. For example, a reusable workflow provides - name: test
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: ${{ inputs.build-context }}(Taken from https://github.com/chgl/.github/blob/master/.github/workflows/standard-build.yaml#L178-L192). Zizmor now remarks: note[template-injection]: code injection via template expansion
--> ./.github/workflows/standard-build.yaml:178:9
|
178 | - name: Build unit test image layer
| --------------------------------- note: this step
179 | if: ${{ inputs.enable-build-test-layer == true }}
...
182 | with:
183 | context: ${{ inputs.build-context }}
| ------------------------------------ note: ${{ inputs.build-context }} may expand into attacker-controllable code
|
= note: audit confidence → UnknownIs there any way to handle such cases? Or even ignore them explicitly? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
|
Hey @chgl, thanks for opening a discussion.
To qualify: zizmor/crates/zizmor/data/codeql-injection-sinks.json Lines 9 to 13 in 45be0d6 That in turn was derived from CodeQL's model here: However, from a look, I'm not 100% clear on why CodeQL thinks that this input is a code injection source -- TL;DR: This might be an upstream bug in CodeQL's data, which I'll be looking into. However, in the mean time, you could also manually ignore this with a - name: test
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: ${{ inputs.build-context }} # zizmor: ignore[template-injection] |
Beta Was this translation helpful? Give feedback.
Given the above, I think this is a true positive, albeit a confusing one (since the code execution in question is via a handlebars expression).