Bump cross-spawn from 7.0.6 to 7.1.2
Type: Pull Request
State: Open
Association: Unknown
Comments: 2
(about 5 hours ago)
(about 5 hours ago)
dependencies javascript
Bumps cross-spawn from 7.0.6 to 7.1.2.
Release notes
Sourced from cross-spawn's releases.
v7.1.2
Bug fixes
- Batch files found in
PATHsee their own directory again (#203, #204). Since 7.1.0, a batch file run by its name, e.g.gradle, got the current directory in%~dp0on Windows, which broke batch files that use it to find their own files, such as Gradle's (Unable to access jarfile). Batch files are now run by the path they resolved to.v7.1.1
Security
This release fixes a command injection vulnerability that affects Windows only (GHSA-w3gc-668g-rf8f, high).
7.1.0 fixed how arguments are escaped for batch files, but that escaping only applied when cross-spawn detected that the command was a batch file. When the command wasn't written as a plain program name or path, e.g. it contained double quotes or a space, cross-spawn could miss that
cmd.exewould run a batch file, and escape the arguments for a regular program instead, which allowed running arbitrary commands.Please upgrade.
cross-spawn@6users can upgrade to 6.0.8.Behaviour change
On Windows, commands that run through
cmd.exeare now always quoted. As on other platforms, the command must be the name or path of a single program, with its arguments passed inargs:spawn('npm install')now fails withENOENTinstead of runningnpmwithinstall. Also,cmd.exe's message for a command it can't find now shows the command in quotes, e.g.'"foo"' is not recognized as an internal or external command. See the Windows argument escaping section of the README.v7.1.0
Security
This release fixes two vulnerabilities that affect Windows only:
- Command injection when spawning batch files (GHSA-ghv9-86vm-4v8m, high). Arguments passed to batch files outside
node_modules/.bin, such asnpm.cmdor globally installed package shims, could break out of their quotes and run arbitrary commands.%VAR%and!VAR!could also be expanded in some environments.- Argument injection via backslashes before a double quote (GHSA-m6qr-m48x-3xhh, medium). Since 7.0.4, arguments with two or more backslashes before a double quote, or at their end, could split into extra arguments or swallow the following ones.
Please upgrade.
cross-spawn@6users can upgrade to 6.0.7.Thanks to Duong Bui Thai for privately reporting both, to
@mohd-akramfor reporting the batch file injection in #171, and to@trackoorand@ogffxfor independently reporting and fixing the backslash issue in #188 and #190.Behaviour changes
These only affect Windows, when a command runs through
cmd.exe, i.e. batch files and other non-executable commands:
- Line breaks now throw a
TypeError.cmd.execan't escape them, so arguments with line breaks used to be silently cut short. Bothspawn()andspawn.sync()now throw synchronously instead.- Inner double quotes are escaped as
""for batch files. Programs called by batch files that don't follow the Microsoft C runtime conventions, such as those written in Go or that useCommandLineToArgvW, may now split arguments containing double quotes differently.cmd.exeruns with/e:on /v:off. This also applies to the batch file itself, e.g. one relying on delayed expansion being enabled in the registry.- Batch files that read an argument unquoted with
%~1remain unsafe, as they always were. Please quote it, e.g."%~1", or forward the arguments with%*.Please see the new Windows argument escaping section of the README.
Other changes
- Close the file descriptor when reading a shebang fails (#187). Thanks to
@xiehuanyi.
Changelog
Sourced from cross-spawn's changelog.
7.1.2 (2026-11-29)
Bug Fixes
7.1.1 (2026-11-28)
Bug Fixes
- always quote commands run through cmd.exe (d0ead35)
7.1.0 (2026-11-28)
Bug Fixes
Commits
9bfd202chore(release): 7.1.2fe027b8fix: run batch files by their resolved path on Windowsf408280chore(release): 7.1.1d0ead35fix: always quote commands run through cmd.exea03242echore: upgrade dev dependencies515dc55chore(release): 7.1.04fcac7bdocs: document Windows argument escaping and its limitations244ffeafix: escape commands and arguments safely when running them through cmd.exe9924b88fix: close the file descriptor when reading a shebang fails462a846test: support unit tests next to source files- Additional commits viewable in compare view
Install script changes
This version adds prepare script that runs during installation. Review the package contents before updating.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.
Package Dependencies
Security Advisories
cross-spawn: Command injection on Windows when spawning batch files
cross-spawn: Argument injection on Windows via backslashes before a double quote
cross-spawn: Command injection on Windows when the command is not a plain program name or path
Technical Details
| ID: | 16871396 |
| UUID: | 6718918573 |
| Node ID: | PR_kwDOAixDY88AAAABTNxJqg |
| Host: | GitHub |
| Repository: | cloudfour/cloudfour.com-patterns |