feat: add static analysis for execa() command injection detection#268
feat: add static analysis for execa() command injection detection#268
Conversation
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
✅ Coverage Check PassedOverall Coverage
Coverage comparison generated by |
| /** | ||
| * Checks if a node is a "safe" literal value | ||
| */ | ||
| function isLiteralOrSafe(node) { |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 20 days ago
In general, unused helper functions should be removed to improve readability and avoid confusion about intended behavior. Since isLiteralOrSafe is not referenced, the safest fix that does not alter existing functionality is simply to delete its definition block.
Concretely, in eslint-rules/no-unsafe-execa.js, inside the create(context) { ... } body, remove the entire isLiteralOrSafe function definition, from its JSDoc comment starting at line 67 through its closing brace and terminating semicolon at line 104–104/105, keeping the surrounding code intact. No additional imports, methods, or variables are needed; we only delete dead code.
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
Smoke Test ResultsLast 2 Merged PRs:
Test Results:
Status: FAIL
|
Smoke Test Results (Claude)Last 2 merged PRs:
Test Results: Overall Status: PASS
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation... |
Smoke Test Results - Claude Sonnet 4.5Last 2 Merged PRs:
Test Results:
Status: PASS
|
Smoke Test ResultsLast 2 Merged PRs:
Test Results:
Overall Status: PARTIAL PASS (3/4 tests passed) Author: @Mossaka | Assignees: @Mossaka, @copilot
|
The codebase uses
execa()extensively for shell commands but lacks static analysis to detect unsafe usage patterns that could lead to command injection vulnerabilities.Changes
eslint-plugin-security- General security linting for Node.js (detect-child-process, detect-non-literal-fs, etc.)no-unsafe-execa- Detects:shell: trueoption usageExample Detection
Configuration
Rule is set to
warnlevel since it may produce false positives requiring human review. The rule has a comprehensive test suite ineslint-rules/no-unsafe-execa.test.js.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.