Skip to content

Update dependency cross-spawn to v7.1.0 [SECURITY] - #1975

Open
renovate[bot] wants to merge 3 commits into
mainfrom
renovate/npm-cross-spawn-vulnerability
Open

renovate[bot] wants to merge 3 commits into
mainfrom
renovate/npm-cross-spawn-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
cross-spawn 7.0.6 → 7.1.0 age adoption passing confidence

cross-spawn: Command injection on Windows when spawning batch files

CVE-2026-137199 / GHSA-ghv9-86vm-4v8m

More information

Details

Impact

On Windows, cross-spawn runs commands that aren't executables (.exe or .com), such as batch files (.bat or .cmd), through cmd.exe, and escapes the command and its arguments for it.

A batch file that forwards its arguments, e.g. with %*, makes cmd.exe parse them a second time. cross-spawn only accounted for that second parse when the batch file was an npm cmd-shim located in node_modules/.bin. For any other batch file, such as npm.cmd, globally installed package shims or user batch files, a crafted argument could break out of its quotes and run arbitrary commands:

const spawn = require('cross-spawn');

// Runs calc.exe on Windows
spawn.sync('npm', ['" & calc & "']);

The following were also affected:

  • Batch file detection could be bypassed with trailing dots or spaces in the command name (e.g. tool.bat ), which Windows strips, similar to Node.js' CVE-2024-36138.
  • %VAR% in an argument was expanded if an environment variable named VAR^ existed.
  • !VAR! in an argument was expanded if delayed expansion was enabled in the registry.

Applications are affected if they pass untrusted input as arguments to a command that runs through cmd.exe on Windows. Other platforms aren't affected, and neither is options.shell, which doesn't escape the command or its arguments by design.

Patches

This is fixed in 7.1.0 and 6.0.7. Batch file arguments are now escaped with double quotes, like Rust does since the BatBadBut vulnerability (CVE-2024-24576), % is neutralized, cmd.exe runs with /e:on /v:off, batch files are detected after stripping trailing dots and spaces, and line breaks, which cmd.exe can't escape, are rejected with a TypeError.

Some limitations can't be fixed by any escaping, such as batch files that use %~1 unquoted. Please see the "Windows argument escaping" section of the README.

Workarounds

Validate untrusted input so that only a safe subset is allowed, and call executables directly rather than through batch files.

Credits

Thanks to Duong Bui Thai (LinkedIn) for privately reporting the quote breakout through batch files outside node_modules/.bin and the !VAR! expansion under delayed expansion, and to @​mohd-akram for publicly reporting the batch file injection in #​171.

Severity

  • CVSS Score: 9.2 / 10 (Critical)
  • Vector String: CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

moxystudio/node-cross-spawn (cross-spawn)

v7.1.0

Compare Source

Bug Fixes
  • close the file descriptor when reading a shebang fails (9924b88)
  • escape commands and arguments safely when running them through cmd.exe (244ffea)
7.0.6 (2024-11-18)
Bug Fixes
  • update cross-spawn version to 7.0.5 in package-lock.json (f700743)
7.0.5 (2024-11-07)
Bug Fixes
  • fix escaping bug introduced by backtracking (640d391)
7.0.4 (2024-11-07)
Bug Fixes
7.0.3 (2020-05-25)
Bug Fixes
7.0.2 (2020-04-04)
Bug Fixes
7.0.1 (2019-10-07)
Bug Fixes

Configuration

📅 Schedule: (in timezone America/Los_Angeles)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added dependencies Pull requests that update a dependency file security labels Dec 1, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8c8f0d9
Status: ✅  Deploy successful!
Preview URL: https://b2d8bf23.mouseterm.pages.dev
Branch Preview URL: https://renovate-npm-cross-spawn-vul.mouseterm.pages.dev

View logs

@dormouse-bot dormouse-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Build & Test fails at "Dependency disclosure is current": website/src/data/dependencies-npm.json still lists cross-spawn 7.0.6. I'm pushing the regenerated snapshot (a one-line 7.0.6 → 7.1.0 change from node website/scripts/generate-deps.js).

@renovate

renovate Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants