Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/audits.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,23 @@ from the expanded template.
This avoids the vulnerability, since variable expansion is subject to normal
shell quoting/expansion rules.

!!! tip

To fully remediate the vulnerability, you **should not** use
`${{ env.VARNAME }}`, since that is still a template expansion.
Instead, you should use `${VARNAME}` to ensure that the shell *itself*
performs the variable expansion.


!!! tip

When switching to `${VARNAME}`, keep in mind that different shells have
different environment variable syntaxes. In particular, Powershell (the
default shell on Windows runners) uses `${env:VARNAME}`.

To avoid having to specialize your handling for different runners,
you can set `shell: sh` or `shell: bash`.

=== "Before"

```yaml title="template-injection.yml" hl_lines="3"
Expand Down
Loading