mirror of
https://github.com/github/spec-kit.git
synced 2026-07-06 22:32:13 +08:00
harden: reject shell=True in run_command (#3132)
run_command() forwarded shell= straight to subprocess.run, so a caller passing shell=True would invoke a shell. Reject shell=True with ValueError (keeping the parameter for signature compatibility) and drop shell= from both subprocess.run calls. Enable ruff S602/S604/S605 to flag any future shell=True reintroduction, annotate the one intentional workflow shell sink with # noqa: S602, and document the shell-step execution risk in workflows/PUBLISHING.md.
This commit is contained in:
@@ -31,7 +31,7 @@ class ShellStep(StepBase):
|
||||
# control commands; catalog-installed workflows should be reviewed
|
||||
# before use (see PUBLISHING.md for security guidance).
|
||||
try:
|
||||
proc = subprocess.run(
|
||||
proc = subprocess.run( # noqa: S602 -- intentional shell=True (see NOTE above)
|
||||
run_cmd,
|
||||
shell=True,
|
||||
capture_output=True,
|
||||
|
||||
Reference in New Issue
Block a user