fix(security): eliminate supply chain risks from npx and shell execution#451
Conversation
- aios.js: replace `execSync('npx aios-core install')` in doctor --fix
with local `runWizard()` call to avoid resolving packages from npm registry
- aios-init.js: refactor `spawnAsync()` to accept program + args array
instead of string splitting with `shell: true`
- Removes two supply chain attack vectors (compromised npm package
would execute arbitrary code via npx or shell interpretation)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@riaworks is attempting to deploy a commit to the Pedro Valério Lopez's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Note Reviews pausedUse the following commands to manage reviews:
Use the checkboxes below for quick actions:
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@coderabbitai ignore |
|
✅ Actions performedReviews paused. |
Summary
execSync('npx aios-core install --force --quiet')indoctor --fixwith localrunWizard()call — eliminates supply chain risk from resolving packages via npm registry at runtimespawnAsync()from string-basedcommand.split(' ')withshell: truetoprogram + args[]without shell interpretationContext
Supply chain via npx (aios.js)
When
aios doctor --fixdetects a missing installation, it rannpx aios-core installwhich resolves the package from the npm registry. A compromisedaios-corepackage on npm would execute arbitrary code. The fix uses the localrunWizard()function that's already available in the same file.Shell execution (aios-init.js)
spawnAsync()usedcommand.split(' ')+shell: true, allowing shell metacharacter injection. Refactored to accept(program, args[])directly.Files Changed
bin/aios.js:478execSync('npx ...')→await runWizard(...)bin/aios-init.js:43spawnAsync(string)→spawnAsync(program, args[])bin/aios-init.js:484Test plan
aios doctor --fixuses local wizard instead of npxaios-init.jsinstalls CLI tools correctly with array-based spawn🤖 Generated with Claude Code