Align behavior of inheriting shell with Node.js' child_process API#2447
Merged
ericcornelissen merged 8 commits intomainfrom Apr 5, 2026
Merged
Align behavior of inheriting shell with Node.js' child_process API#2447ericcornelissen merged 8 commits intomainfrom
shell with Node.js' child_process API#2447ericcornelissen merged 8 commits intomainfrom
Conversation
Create a new (compatibility) test suite that tests the assumptions this library makes about the runtime. Because the behavior of the runtime can change over time this is classified and ran as a compatibility test. We assume that the runtime doesn't change its behavior with respect to these assumption within a major version. This test suite does NOT have test coverage because, put simply, we shouldn't be running this libraries code in this suite. The only test in the suite so far tests if the runtime inherits the `shell` option from the prototype. The motivation for testing this is that the library currently assumes it does not (see `src/internal/options.js` line 52) but this test demonstrates that for older Node.js version the runtime does actually use the prototype's value, indicating a bug in the library (namely: this _could_ lead to `node:child_process` and Shescape disagreeing about the shell being used which may enable bypassing escaping).
Aligning with the behavior of the `child_process` API in older versions, as per the assumptions test suite.
- Document `npm run test:compat:assumptions`. - Add `npm run test:compat:regexp:all` to align with other `test:compat:*` targets as well as the fact that in CI `npm run test:compat:regexp` is run for (almost) all Node.js versions.
Clarify explicitly that polluted prototypes (i.e., untrusted "Node environments") are considered out of scope through the threat model.
ericcornelissen
commented
Mar 29, 2026
ericcornelissen
commented
Mar 29, 2026
| "test:compat:assumptions:all": "nve 14.18.0,16.13.0,18.0.0,19.0.0,20.0.0,22.0.0,24.0.0,25.0.0 npm run test:compat:assumptions", | ||
| "test:compat:runtime": "node test/compat/runtime/runner.js", | ||
| "test:compat:runtime:all": "nve 14.18.0,16.13.0,18.0.0,19.0.0,20.0.0,22.0.0 npm run test:compat", | ||
| "test:compat:runtime:all": "nve 14.18.0,16.13.0,18.0.0,19.0.0,20.0.0,22.0.0,24.0.0,25.0.0 npm run test:compat:runtime", |
Owner
Author
Because it is not compatible with all supported Node.js versions.
shell with Node.js' child_process API
This comment was marked as resolved.
This comment was marked as resolved.
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 4ead056a-4c5f-461b-aa1f-48d2f1cffcb4
📒 Files selected for processing (12)
.github/workflows/checks.ymlCHANGELOG.mdCONTRIBUTING.mdSECURITY.mdconfig/eslint.jspackage.jsonsrc/index.jssrc/internal/options.jstest/_arbitraries.jstest/compat/assumptions/child-process.test.jstest/compat/assumptions/runner.jstest/unit/options/parse-options.test.js
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
Create a new (compatibility) test suite that tests the assumptions this library makes about the runtime. Because the behavior of the runtime can change over time this is classified and ran as a compatibility test. We assume that the runtime doesn't change its behavior with respect to these assumption within a major version. This test suite does NOT have test coverage because, put simply, we shouldn't be running this libraries code in this suite.