Skip to content

Fix: resolve Zizmor template and env findings - #119

Merged
tykeal merged 1 commit into
lfreleng-actions:mainfrom
modeseven-lfreleng-actions:fix/zizmor-findings
Jun 24, 2026
Merged

tykeal merged 1 commit into
lfreleng-actions:mainfrom
modeseven-lfreleng-actions:fix/zizmor-findings

Conversation

@ModeSevenIndustrialSolutions

@ModeSevenIndustrialSolutions ModeSevenIndustrialSolutions commented Jun 24, 2026 •

Copy link
Copy Markdown
Member

Pull request overview

Zizmor's regular-persona audit (the configuration used by the
organisation-level scheduled scan) reported template-injection and
github-env findings in this composite action. This change resolves
all of them, bringing the action to zero medium-or-higher findings.

Changes

  • template-injection / github-env (path_prefix): the setup step
    exposed path_prefix via $GITHUB_ENV, and several later steps
    interpolated ${{ env.path_prefix }} directly into templated fields
    and a run block. path_prefix is now promoted to a proper step
    output (id: setup), and every consumer reads
    steps.setup.outputs.path_prefix. The setup.cfg step receives the
    value through a dedicated env: block and references it as a quoted
    shell variable instead of expanding a template into the run body.

  • output-injection hardening: because path_prefix is
    user-controlled, it is emitted to $GITHUB_OUTPUT using the
    documented multiline-delimiter form, so a value containing a newline
    cannot append additional output keys.

  • github-env (capture step): the capture step wrote each result to
    both $GITHUB_ENV and $GITHUB_OUTPUT. The README documents only
    the step outputs as the public contract, so the redundant
    $GITHUB_ENV writes have been removed.

Impact

The action's documented output contract is unchanged.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the composite GitHub Action to address Zizmor findings by eliminating risky $GITHUB_ENV usage and avoiding direct template interpolation of path_prefix into shell bodies, while keeping the action’s documented outputs unchanged.

Changes:

  • Promote path_prefix from $GITHUB_ENV to a dedicated setup step output and update all consumers to use steps.setup.outputs.path_prefix.
  • Pass path_prefix into the setup.cfg parsing step via an env: variable and reference it as a quoted shell variable in run:.
  • Remove redundant $GITHUB_ENV writes in the capture step, keeping $GITHUB_OUTPUT as the sole documented contract.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread action.yaml Resolved
Zizmor's regular-persona audit flagged template-injection and
github-env findings in the composite action.

The setup step exposed path_prefix via GITHUB_ENV, then several
later steps interpolated ${{ env.path_prefix }} directly into
templated fields and a run block. Promote path_prefix to a proper
step output (id: setup) and rewire every consumer to read
steps.setup.outputs.path_prefix. The setup.cfg step now receives
the value through a dedicated env block and references it as a
quoted shell variable rather than expanding a template into the
run body.

path_prefix is user-controlled, so emit it to GITHUB_OUTPUT using
the documented multiline-delimiter form: a value containing a
newline cannot append additional output keys (output-injection
hardening).

The capture step wrote each result to both GITHUB_ENV and
GITHUB_OUTPUT. The README documents only the step outputs as the
public contract, so drop the redundant GITHUB_ENV writes that
triggered the github-env finding.

The action's documented output contract is unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@tykeal tykeal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 Dependamerge
Approved this pull request ✅

@tykeal
tykeal merged commit 3ac9e1e into lfreleng-actions:main Jun 24, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants