[Security] Harden cloudflared installation against command injection - #7656
[Security] Harden cloudflared installation against command injection#7656gonzaloriestra wants to merge 1 commit into
Conversation
Replace `child_process.execSync` with `exec` from `@shopify/cli-kit/node/system` in `install-cloudflared.ts` to prevent shell injection. Updated corresponding tests to mock the new internal utility.
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
User's Goal
Harden the cloudflared installation process against potential command injection vulnerabilities as per the security hardening guidelines.
Evaluation of the Solution
child_process.execSyncwithsystem.execinpackages/plugin-cloudflare/src/install-cloudflared.ts. This ensures that arguments are passed as an array rather than a single shell-evaluated string, mitigating shell injection risks.packages/plugin-cloudflare/src/install-cloudflared.test.tsto mock the newsystem.executility. All tests in the package passed successfully.execinstead ofexecSync.Safety & Side Effects
execis safe. All existing tests pass.package.jsonortsconfig.json.Testing performed
pnpm --filter @shopify/plugin-cloudflare vitest run(18/18 tests passed).pnpm --filter @shopify/plugin-cloudflare exec eslint src/install-cloudflared.ts(No issues).npx nx type-check plugin-cloudflare(Success).npx knip --include-libs --workspace packages/plugin-cloudflare(No issues).PR created automatically by Jules for task 14450443894515539450 started by @gonzaloriestra