Skip to content

Fix potential template injection in setup-env-file - #513

Merged
mandreko-bitwarden merged 1 commit into
mainfrom
template-injection-fix
Jul 13, 2026
Merged

Fix potential template injection in setup-env-file#513
mandreko-bitwarden merged 1 commit into
mainfrom
template-injection-fix

Conversation

@mandreko-bitwarden

Copy link
Copy Markdown
Contributor

📔 Objective

This PR fixes some potential template injection in the setup-env-file action. It was using values directly from input which goes against best practices.

@mandreko-bitwarden
mandreko-bitwarden requested a review from a team as a code owner July 10, 2026 14:36
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR remediates a potential GitHub Actions template-injection vulnerability (CWE-94) in the setup-env-file composite action. All ${{ }} expressions are moved out of the run: script body into an env: block and referenced as shell variables, which is GitHub's recommended mitigation. The .env generation is refactored into a single grouped redirect and which node is now safely quoted.

Code Review Details

No blocking findings. Verified:

  • All Key Vault secrets and action inputs are correctly mapped to KV_*/IN_* env vars and referenced consistently in each echo line — no name mismatches.
  • The single { ... } > .env block redirect preserves the original truncate-then-append behavior.
  • "$(which node)" quoting is an improvement over the backtick form.
  • The residual \"...\" wrapping of values is unchanged pre-existing behavior over trusted Bitwarden-controlled data, so it is out of scope for this fix.

@mandreko-bitwarden
mandreko-bitwarden merged commit 072297c into main Jul 13, 2026
12 checks passed
@mandreko-bitwarden
mandreko-bitwarden deleted the template-injection-fix branch July 13, 2026 14:07
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.

2 participants