analytics-next icon indicating copy to clipboard operation
analytics-next copied to clipboard

fix shell command built from environment values

Open odaysec opened this issue 7 months ago • 1 comments

https://github.com/segmentio/analytics-next/blob/80ef0bee716ee616ce9369da946be2999f3fe3a4/packages/browser/scripts/vendor/run.js#L6-L12

Fix the issue will replace the use of execSync with execFileSync and pass the command arguments separately. This approach avoids shell interpretation of the dynamically constructed command string. Specifically:

  1. Replace the dynamic command string `yarn webpack --config ${configPath}` with the command yarn and arguments ['webpack', '--config', configPath].
  2. Update the execSync call to use execFileSync with the new command and arguments.

This change ensures that the configPath value is treated as a literal argument and not subject to shell interpretation.


References

odaysec avatar May 17 '25 17:05 odaysec

⚠️ No Changeset found

Latest commit: ce0b3aae3d5459e2e0386a1c29a5063a6315fa0e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar May 17 '25 17:05 changeset-bot[bot]