Skip to content

[Security] Add command safety check to execCommand#7448

Merged
gonzaloriestra merged 2 commits intomainfrom
sentinel-fix-execcommand-safety-17378133700905160634
May 5, 2026
Merged

[Security] Add command safety check to execCommand#7448
gonzaloriestra merged 2 commits intomainfrom
sentinel-fix-execcommand-safety-17378133700905160634

Conversation

@gonzaloriestra
Copy link
Copy Markdown
Contributor

@gonzaloriestra gonzaloriestra commented May 3, 2026

Related to https://github.com/Shopify/develop-app-inner-loop/issues/120

What was improved

Added a security check to execCommand to prevent execution of unsecure binaries in the current directory.

How to test your changes?

Run the tests for the @shopify/cli-kit package:
pnpm --filter @shopify/cli-kit vitest run src/public/node/system.test.ts

The new test case "raises an error if the command to run is found in the current directory" should pass.


PR created automatically by Jules for task 17378133700905160634 started by @gonzaloriestra

@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label May 3, 2026
This change adds a call to `checkCommandSafety` in the `execCommand` function in `packages/cli-kit/src/public/node/system.ts`. This ensures that any command executed via `execCommand` is checked for unsecure binaries in the current working directory, preventing binary planting/PATH hijacking attacks.

A test case has been added to `packages/cli-kit/src/public/node/system.test.ts` to verify this behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gonzaloriestra gonzaloriestra force-pushed the sentinel-fix-execcommand-safety-17378133700905160634 branch from b673995 to 73306da Compare May 4, 2026 08:23
@gonzaloriestra gonzaloriestra marked this pull request as ready for review May 4, 2026 08:59
@gonzaloriestra gonzaloriestra requested a review from a team as a code owner May 4, 2026 08:59
@gonzaloriestra gonzaloriestra added the Jules Created by Jules label May 4, 2026
Copy link
Copy Markdown
Contributor

@dmerand dmerand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agent found a helpful note here.

Comment thread packages/cli-kit/src/public/node/system.ts Outdated
@gonzaloriestra gonzaloriestra added this pull request to the merge queue May 5, 2026
Merged via the queue into main with commit ef86ca4 May 5, 2026
93 of 101 checks passed
@gonzaloriestra gonzaloriestra deleted the sentinel-fix-execcommand-safety-17378133700905160634 branch May 5, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Jules Created by Jules no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants