Skip to content

Fix DEP0190: remove all execFile+shell:true usage#147

Merged
that-github-user merged 1 commit into
mainfrom
fix-135-dep0190
Mar 29, 2026
Merged

Fix DEP0190: remove all execFile+shell:true usage#147
that-github-user merged 1 commit into
mainfrom
fix-135-dep0190

Conversation

@that-github-user

Copy link
Copy Markdown
Owner

Summary

Replace execFile(cmd, args, {shell:true}) with exec(cmdString) in:

  • src/scoring/test-runner.ts — test execution
  • src/commands/run.ts — preflight test run

The shell:true + args pattern is deprecated (Node.js DEP0190) because args aren't escaped when shell mode is used. Since we validate commands via validateTestCommand() before execution, using exec() directly is both safer (no false security from args array) and eliminates the deprecation warning.

This is a pre-publish security fix — needed before npm release (#139/#146).

Change type

  • Bug fix

Related issue

Closes #135

How to test

npm test  # 237 tests pass
npx tsx src/cli.ts run --attempts 1 -t "npm test" "trivial task" 2>&1 | grep DEP0190
# Should output nothing — warning is gone

Breaking changes

  • This PR introduces breaking changes

🤖 Generated with Claude Code

Replace execFile(cmd, args, {shell:true}) with exec(cmdString) in
test-runner.ts and run.ts preflightTestRun. The shell:true+args pattern
is deprecated (DEP0190) because args aren't escaped, making it equivalent
to string concatenation. Since we validate commands via validateTestCommand
before execution, using exec directly is both safer and more honest.

Closes #135

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@that-github-user that-github-user merged commit 5fc9d02 into main Mar 29, 2026
4 checks passed
@that-github-user that-github-user deleted the fix-135-dep0190 branch March 29, 2026 05: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.

Fix DEP0190 deprecation: execFile with shell:true passes args unsafely

1 participant