fix(publish-npm)!: pass command inputs through env to prevent template injection - #183
Open
PierreJeanjacquot wants to merge 1 commit into
Open
PierreJeanjacquot wants to merge 1 commit into
PierreJeanjacquot wants to merge 1 commit into
Conversation
PierreJeanjacquot
added a commit
that referenced
this pull request
Oct 5, 2026
…nputs
The *-command inputs are meant to run arbitrary shell provided by the caller workflow, so the injection is by design. Fixing it the way zizmor suggests (passing the value through an env var and running it as ${VAR}) would stop bash from parsing the value as a script, so callers could only pass a single simple command: multi-line commands, &&, pipes and quotes would no longer work. This breaking change is deferred to a dedicated PR. (#183)
PierreJeanjacquot
added a commit
that referenced
this pull request
Oct 5, 2026
…nputs
The *-command inputs are meant to run arbitrary shell provided by the caller workflow, so the injection is by design. Fixing it the way zizmor suggests (passing the value through an env var and running it as ${VAR}) would stop bash from parsing the value as a script, so callers could only pass a single simple command: multi-line commands, &&, pipes and quotes would no longer work. This breaking change is deferred to a dedicated PR. (#183)
PierreJeanjacquot
added a commit
that referenced
this pull request
Oct 5, 2026
…nputs
The *-command inputs are meant to run arbitrary shell provided by the caller workflow, so the injection is by design. Fixing it the way zizmor suggests (passing the value through an env var and running it as ${VAR}) would stop bash from parsing the value as a script, so callers could only pass a single simple command: multi-line commands, &&, pipes and quotes would no longer work. This breaking change is deferred to a dedicated PR. (#183)
PierreJeanjacquot
added a commit
that referenced
this pull request
Oct 5, 2026
…nputs
The *-command inputs are meant to run arbitrary shell provided by the caller workflow, so the injection is by design. Fixing it the way zizmor suggests (passing the value through an env var and running it as ${VAR}) would stop bash from parsing the value as a script, so callers could only pass a single simple command: multi-line commands, &&, pipes and quotes would no longer work. This breaking change is deferred to a dedicated PR. (#183)
PierreJeanjacquot
added a commit
that referenced
this pull request
Oct 5, 2026
…nputs
The *-command inputs are meant to run arbitrary shell provided by the caller workflow, so the injection is by design. Fixing it the way zizmor suggests (passing the value through an env var and running it as ${VAR}) would stop bash from parsing the value as a script, so callers could only pass a single simple command: multi-line commands, &&, pipes and quotes would no longer work. This breaking change is deferred to a dedicated PR. (#183)
…e injection
The *-command inputs were expanded directly into run scripts, letting any value inject arbitrary shell. They are now passed through environment variables and expanded as `${VAR}`, so bash no longer parses them as a script.
BREAKING CHANGE: install-command, build-command, test-command, lint-command, type-check-command and format-check-command now only accept a single command with its arguments. Multi-line scripts, `&&`, `;`, pipes, redirections, quotes and inline env assignments (`FOO=bar cmd`) are no longer supported; move such logic into an npm script and call it with `npm run <script>`.
PierreJeanjacquot
force-pushed
the
fix/prevent-template-injection
branch
from
October 5, 2026 15:42
bfd7fac to
fc1c9a7
Compare
PierreJeanjacquot
marked this pull request as ready for review
October 5, 2026 15:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes zizmor findings
BREAKING CHANGE: install-command, build-command, test-command, lint-command, type-check-command and format-check-command now only accept a single command with its arguments. Multi-line scripts,
&&,;, pipes, redirections, quotes and inline env assignments (FOO=bar cmd) are no longer supported; move such logic into an npm script and call it withnpm run <script>.