Repository navigation
Update cross-spawn and ws for the dependency audit - #159
Merged
Merged
Conversation
On Windows, pnpm is often a global batch file outside node_modules/.bin. cmd.exe reads the arguments of such a file a second time. This test sends real updater arguments through a temporary batch file and checks that they arrive unchanged. It fails with cross-spawn 7.0.6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 51 minutes. View limit details
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. |
cross-spawn 7.1.2 fixes GHSA-ghv9-86vm-4v8m: arguments for batch files outside node_modules/.bin, such as a global pnpm.cmd, now keep their quoting when cmd.exe reads them again. ws 8.23.1 fixes GHSA-37g9-w4hg-h9qr in test and local development tools. Overrides keep one version of each. cross-spawn 7.1 refuses a line break in a batch-file argument, because cmd.exe cannot carry it. The D1 helpers now send their SQL on one line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
The paired quotes in the updater SQL do not show the advisory: cmd.exe still keeps their metacharacters inside quotes on its second read. An argument with an unpaired quote does. With cross-spawn 7.0.6, cmd.exe would run the rest of that argument as a command. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bermanto
marked this pull request as ready for review
December 3, 2026 02:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pnpm audit --prodfails onmainsince 2026-12-01 because of two public advisories:cross-spawnbefore 7.1.0 escapes arguments incorrectly for batch files outsidenode_modules/.bin. On Windows, the updater startspnpmthroughcross-spawn, andpnpmis often a global batch file. cmd.exe reads its arguments a second time, so updater SQL with",|,>, or%could reachwranglerchanged. Stable 1.4.0 and 1.4.7 lock 7.0.6.wsbefore 8.23.0. It comes only fromhappy-dom(tests) andminiflare(local development). It is not in the Worker bundle.This change:
cross-spawn7.1.2 and adds overrides forcross-spawn7.1.2 andws@88.23.1. Without the override,@modelcontextprotocol/sdkkeeps 7.0.6. Both versions pass the minimum release age.oneLineSql()toscripts/shell.mjs. Since 7.1,cross-spawnthrows aTypeErrorfor a line break in a batch-file argument, because cmd.exe cannot carry it. Two updater queries span several lines:afterDeploySchemaSqlandreleaseInspectionSql. All five D1--commandcallers now send their SQL on one line. The SQL has no--comments, and a test checks this.No documentation describes this argument handling, so no site change is necessary.
Tests
quality-windows) start a real.cmdfile outsidenode_modules/.binthat forwards%*tonode:',"from",||,->,%,&,|,>,^,( ), a path with spaces, and an unpaired quote arrive unchanged.oneLineSql().TypeError.quality-windows. The updater SQL has its"in pairs, so cmd.exe still keeps|and>inside quotes on its second read. The last commit adds the advisory's own pattern, an argument with an unpaired quote. CI runs that case only with 7.1.2. A local simulation (withprocess.platformset towin32) shows the cmd.exe line for" & echo injected & ":^"\^"^ ^&^ echo^ injected^ ^&^ \^"^". After the first read removes the carets, the batch file gets"\" & echo injected & \"", and its second read runsecho injected.""" & echo injected & """. The&stays inside quotes on both reads.queryRemoteD1()andexecuteSql()tests check one-line SQL. They fail on the old helpers.pnpm audit --prod --audit-level=moderate: no known vulnerabilities.pnpm checkpassed: 1068 unit tests (5 skipped, including the Windows-only tests on macOS) and 232 integration tests.pnpm deploy:dry-runpassed.User-facing summary for the next Nightly: Update
cross-spawnto 7.1.2 for GHSA-ghv9-86vm-4v8m. On Windows, the updater now sends its SQL topnpmandwrangleron one line and with correct quoting.🤖 Generated with Claude Code