File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -462,6 +462,23 @@ from the expanded template.
462462This avoids the vulnerability, since variable expansion is subject to normal
463463shell quoting/expansion rules.
464464
465+ !!! tip
466+
467+ To fully remediate the vulnerability, you **should not** use
468+ `${{ env.VARNAME }}`, since that is still a template expansion.
469+ Instead, you should use `${VARNAME}` to ensure that the shell *itself*
470+ performs the variable expansion.
471+
472+
473+ !!! tip
474+
475+ When switching to `${VARNAME}`, keep in mind that different shells have
476+ different environment variable syntaxes. In particular, Powershell (the
477+ default shell on Windows runners) uses `${env:VARNAME}`.
478+
479+ To avoid having to specialize your handling for different runners,
480+ you can set `shell: sh` or `shell: bash`.
481+
465482=== "Before"
466483
467484 ```yaml title="template-injection.yml" hl_lines="3"
You can’t perform that action at this time.
0 commit comments