Skip to content

fix: pass ignore-policies input via env instead of interpolating into run - #352

Open
Omerg-Legit wants to merge 1 commit into
mainfrom
fix/shell-injection-ignore-policies-input
Open

Omerg-Legit wants to merge 1 commit into
mainfrom
fix/shell-injection-ignore-policies-input

Conversation

@Omerg-Legit

@Omerg-Legit Omerg-Legit commented Aug 24, 2026

Copy link
Copy Markdown

Summary

  • Pass ignore-policies through the step's env: block instead of interpolating ${{ }} into the run: script — the pattern the analyze step in this file already uses.
  • Actions substitutes the input as text before the shell parses the script, so a value containing a double quote could terminate the echo and chain further commands in the runner context.
  • Use printf over echo so a value beginning with - is written verbatim rather than consumed as an echo flag.

… run

The create_ignore_policies_file step substituted ${{ inputs.ignore-policies }}
directly into a bash command. Actions performs that substitution as text before
the shell parses the script, so a value containing a double quote could
terminate the echo and chain further commands in the runner context.

Pass the value through the step's env block and reference it as a shell
variable, which is the pattern the analyze step in this same file already uses.
This also fixes a latent correctness bug: inside double quotes, a policy list
containing $, backticks or backslashes was expanded rather than written
literally.

printf is used in place of echo so values beginning with '-' or containing
backslash escapes are written verbatim.
@Omerg-Legit
Omerg-Legit requested a review from a team as a code owner August 24, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant