Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: template-injection: filter static envs #318

Merged
merged 1 commit into from
Dec 17, 2024
Merged

Conversation

woodruffw
Copy link
Owner

This eliminates a class of false positives in the template-injection audit, where ${{ env.foo }} was flagged as a potential injection source despite foo being defined as a literal (non-expression) string in one of the workflow's env: blocks.

More generally, there's still a group of false positives this doesn't address. For example:

run: echo "${{ env.foo }}"
env: 
  foo: ${{ true }} # or anything else safe

This still flags ${{ env.foo }} as an injection source, despite foo's value coming from a "safe" template expansion.

Closes #313.

Signed-off-by: William Woodruff <william@yossarian.net>
@woodruffw woodruffw added enhancement New feature or request false-positive labels Dec 17, 2024
@woodruffw woodruffw self-assigned this Dec 17, 2024
@woodruffw woodruffw merged commit a5c9bfa into main Dec 17, 2024
5 checks passed
@woodruffw woodruffw deleted the ww/static-env branch December 17, 2024 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request false-positive
Projects
None yet
Development

Successfully merging this pull request may close these issues.

template-injection: eliminate false positives with the env.* context
1 participant