remove shell usage during builds - #45
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes shell execution from local workspace compiler build steps to reduce command-injection risk, and adds regression coverage to ensure untrusted build configuration values can’t be executed via shell interpolation.
Changes:
- Removed explicit shell usage when spawning
cargoin the Rust workspace compiler (avoids shell-based command injection via.cargo/config.toml). - Added
child_process"error"handlers for Rust/JS/AssemblyScript build spawns so missing toolchain binaries reject cleanly instead of crashing the server. - Added a regression test validating that an injected payload in
.cargo/config.tomldoes not execute, and wired it into the defaultnpm testscript.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/tools/local/workspace/compiler/rustBuild.ts |
Stops spawning cargo through a shell and adds spawn error handling. |
src/tools/local/workspace/compiler/jsBuild.ts |
Adds spawn error handling for npx-based JS builds. |
src/tools/local/workspace/compiler/asBuild.ts |
Adds spawn error handling for npx-based AssemblyScript builds. |
scripts/tests/test-compiler-injection.ts |
New regression test ensuring .cargo/config.toml target injection can’t execute shell payloads. |
package.json |
Adds test:compiler-injection and includes it in the default test script. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
qrdl
approved these changes
Aug 28, 2026
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.
No description provided.