GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — child_process: validate arguments for null bytes by RaisinTen · Pull Request #44782 · nodejs/node

Conversation

@RaisinTen

@RaisinTen RaisinTen commented Sep 25, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This change adds validation to reject an edge case where the child_process API argument strings might contain null bytes somewhere in between. Such strings were being silently truncated before, so throwing an error should prevent misuses of this API.

Fixes: #44768
Signed-off-by: Darshan Sen [email protected]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@nodejs-github-bot nodejs-github-bot added child_process Issues and PRs related to the child_process subsystem. needs-ci PRs that need a full CI run. labels Sep 25, 2022
@RaisinTen RaisinTen mentioned this pull request Sep 25, 2022
child_process.spawn not checking null byte in args #44768
Closed
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@RaisinTen
RaisinTen force-pushed the child_process/validate-arguments-for-null-bytes branch from c74b77f to 67903b0 Compare September 25, 2022 10:38
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
bnoordhuis
bnoordhuis reviewed Sep 25, 2022
View reviewed changes
Comment thread lib/child_process.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/child_process.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Sep 26, 2022
CI Reliability 2022-09-26 nodejs/reliability#385
Open
CI Reliability 2022-09-27 nodejs/reliability#386
Open
@RaisinTen
child_process: validate arguments for null bytes
a6bb1c4
This change adds validation to reject an edge case where the
child_process API argument strings might contain null bytes
somewhere in between. Such strings were being silently truncated
before, so throwing an error should prevent misuses of this API.

Fixes: nodejs#44768
Signed-off-by: Darshan Sen <[email protected]>
@RaisinTen
RaisinTen force-pushed the child_process/validate-arguments-for-null-bytes branch from 67903b0 to a6bb1c4 Compare October 3, 2022 13:46
@RaisinTen RaisinTen added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 3, 2022
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 3, 2022
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
This was referenced Oct 5, 2022
CI Reliability 2022-10-05 nodejs/reliability#395
Open
CI Reliability 2022-10-06 nodejs/reliability#396
Open
@RaisinTen
RaisinTen requested a review from bnoordhuis October 6, 2022 09:25
@RaisinTen

RaisinTen commented Oct 6, 2022

Copy link
Copy Markdown
Member Author

cc @nodejs/child_process in case anyone else also wants to take a look.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Oct 7, 2022
CI Reliability 2022-10-07 nodejs/reliability#397
Open
20 tasks
ZYSzys
ZYSzys reviewed Oct 7, 2022
View reviewed changes

@ZYSzys ZYSzys left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Should this be semver-major ?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@RaisinTen

RaisinTen commented Oct 7, 2022

Copy link
Copy Markdown
Member Author

@ZYSzys I would say no because code that previously tried to pass string arguments with null bytes was already broken because the strings were silently getting truncated at the first null byte. This validation would make it easier for users to know where things went wrong.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Oct 8, 2022
CI Reliability 2022-10-08 nodejs/reliability#398
Open
CI Reliability 2022-10-09 nodejs/reliability#399
Open
@RaisinTen RaisinTen added the review wanted PRs that need review. label Oct 10, 2022
jasnell
jasnell approved these changes Oct 10, 2022
View reviewed changes
@RaisinTen RaisinTen added author ready PRs with CI started, the required approvals, and no outstanding review comments. and removed review wanted PRs that need review. labels Oct 11, 2022
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@nodejs-github-bot

nodejs-github-bot commented Oct 12, 2022

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/47218/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RaisinTen

RaisinTen commented Oct 12, 2022

Copy link
Copy Markdown
Member Author

@bnoordhuis @ZYSzys would y'all like to take another look?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RaisinTen RaisinTen added the commit-queue PRs queued for automated landing through the Commit Queue. label Oct 14, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Oct 14, 2022
@nodejs-github-bot
nodejs-github-bot merged commit 91dbd8b into nodejs:main Oct 14, 2022
@nodejs-github-bot

nodejs-github-bot commented Oct 14, 2022

Copy link
Copy Markdown
Collaborator

Landed in 91dbd8b

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RaisinTen
RaisinTen deleted the child_process/validate-arguments-for-null-bytes branch October 14, 2022 13:04
RafaelGSS pushed a commit that referenced this pull request Nov 1, 2022
@RaisinTen @RafaelGSS
child_process: validate arguments for null bytes
c2cad0c
This change adds validation to reject an edge case where the
child_process API argument strings might contain null bytes
somewhere in between. Such strings were being silently truncated
before, so throwing an error should prevent misuses of this API.

Fixes: #44768
Signed-off-by: Darshan Sen <[email protected]>
PR-URL: #44782
Reviewed-By: James M Snell <[email protected]>
@RafaelGSS RafaelGSS mentioned this pull request Nov 1, 2022
v19.1.0 proposal #45269
Merged
RafaelGSS pushed a commit that referenced this pull request Nov 10, 2022
@RaisinTen @RafaelGSS
child_process: validate arguments for null bytes
b2e6048
This change adds validation to reject an edge case where the
child_process API argument strings might contain null bytes
somewhere in between. Such strings were being silently truncated
before, so throwing an error should prevent misuses of this API.

Fixes: #44768
Signed-off-by: Darshan Sen <[email protected]>
PR-URL: #44782
Reviewed-By: James M Snell <[email protected]>
@danielleadams danielleadams mentioned this pull request Dec 30, 2022
v18.13.0 release proposal #46025
Merged
danielleadams pushed a commit that referenced this pull request Dec 30, 2022
@RaisinTen @danielleadams
child_process: validate arguments for null bytes
847637a
This change adds validation to reject an edge case where the
child_process API argument strings might contain null bytes
somewhere in between. Such strings were being silently truncated
before, so throwing an error should prevent misuses of this API.

Fixes: #44768
Signed-off-by: Darshan Sen <[email protected]>
PR-URL: #44782
Reviewed-By: James M Snell <[email protected]>
danielleadams pushed a commit that referenced this pull request Jan 3, 2023
@RaisinTen @danielleadams
child_process: validate arguments for null bytes
7b68c06
This change adds validation to reject an edge case where the
child_process API argument strings might contain null bytes
somewhere in between. Such strings were being silently truncated
before, so throwing an error should prevent misuses of this API.

Fixes: #44768
Signed-off-by: Darshan Sen <[email protected]>
PR-URL: #44782
Reviewed-By: James M Snell <[email protected]>
codebytere added a commit to electron/electron that referenced this pull request Jan 9, 2023
@codebytere
child_process: validate arguments for null bytes
1d9dfac
nodejs/node#44782
codebytere added a commit to electron/electron that referenced this pull request Jan 11, 2023
@electron-roller @codebytere
chore: bump node to v18.13.0 (main) (#36818)
1d9a4ab
* chore: bump node in DEPS to v18.13.0

* child_process: validate arguments for null bytes

nodejs/node#44782

* bootstrap: merge main thread and worker thread initializations

nodejs/node#44869

* module: ensure relative requires work from deleted directories

nodejs/node#42384

* src: add support for externally shared js builtins

nodejs/node#44000

* lib: disambiguate `native module` to `binding`

nodejs/node#45673

* test: convert test-debugger-pid to async/await

nodejs/node#45179

* deps: upgrade to libuv 1.44.2

nodejs/node#42340

* src: fix cppgc incompatibility in v8

nodejs/node#43521

* src: use qualified `std::move` call in node_http2

nodejs/node#45555

* build: fix env.h for cpp20

nodejs/node#45516

* test: remove experimental-wasm-threads flag

nodejs/node#45074

* src: iwyu in cleanup_queue.cc

nodejs/node#44983

* src: add missing include for `std::all_of`

nodejs/node#45541

* deps: update ICU to 72.1

nodejs/node#45068

* chore: fixup patch indices

* chore: remove errant semicolons

- nodejs/node#44179
- nodejs/node#44193

* src: add support for externally shared js builtins

nodejs/node#44376

* chore: add missing GN filenames

* deps: update nghttp2 to 1.51.0

nodejs/node#45537

* chore: disable more Node.js snapshot tests

The Snapshot feature is currently disabled

* chore: disable ICU timezone tests

Node.js uses a different version of ICU than Electron so they
will often be out of sync.

* chore: disable threadpool event tracing test

Event tracing is not enabled in embedded Node.js

* chore: fixup patch indices

* chore: comments from review

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <[email protected]>
khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
@electron-roller @codebytere @khalwa
chore: bump node to v18.13.0 (main) (electron#36818)
cd481d5
* chore: bump node in DEPS to v18.13.0

* child_process: validate arguments for null bytes

nodejs/node#44782

* bootstrap: merge main thread and worker thread initializations

nodejs/node#44869

* module: ensure relative requires work from deleted directories

nodejs/node#42384

* src: add support for externally shared js builtins

nodejs/node#44000

* lib: disambiguate `native module` to `binding`

nodejs/node#45673

* test: convert test-debugger-pid to async/await

nodejs/node#45179

* deps: upgrade to libuv 1.44.2

nodejs/node#42340

* src: fix cppgc incompatibility in v8

nodejs/node#43521

* src: use qualified `std::move` call in node_http2

nodejs/node#45555

* build: fix env.h for cpp20

nodejs/node#45516

* test: remove experimental-wasm-threads flag

nodejs/node#45074

* src: iwyu in cleanup_queue.cc

nodejs/node#44983

* src: add missing include for `std::all_of`

nodejs/node#45541

* deps: update ICU to 72.1

nodejs/node#45068

* chore: fixup patch indices

* chore: remove errant semicolons

- nodejs/node#44179
- nodejs/node#44193

* src: add support for externally shared js builtins

nodejs/node#44376

* chore: add missing GN filenames

* deps: update nghttp2 to 1.51.0

nodejs/node#45537

* chore: disable more Node.js snapshot tests

The Snapshot feature is currently disabled

* chore: disable ICU timezone tests

Node.js uses a different version of ICU than Electron so they
will often be out of sync.

* chore: disable threadpool event tracing test

Event tracing is not enabled in embedded Node.js

* chore: fixup patch indices

* chore: comments from review

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <[email protected]>
gecko19 pushed a commit to brightsign/electron that referenced this pull request Feb 28, 2023
@electron-roller @codebytere @gecko19
chore: bump node to v18.13.0 (main) (electron#36818)
730c38e
* chore: bump node in DEPS to v18.13.0

* child_process: validate arguments for null bytes

nodejs/node#44782

* bootstrap: merge main thread and worker thread initializations

nodejs/node#44869

* module: ensure relative requires work from deleted directories

nodejs/node#42384

* src: add support for externally shared js builtins

nodejs/node#44000

* lib: disambiguate `native module` to `binding`

nodejs/node#45673

* test: convert test-debugger-pid to async/await

nodejs/node#45179

* deps: upgrade to libuv 1.44.2

nodejs/node#42340

* src: fix cppgc incompatibility in v8

nodejs/node#43521

* src: use qualified `std::move` call in node_http2

nodejs/node#45555

* build: fix env.h for cpp20

nodejs/node#45516

* test: remove experimental-wasm-threads flag

nodejs/node#45074

* src: iwyu in cleanup_queue.cc

nodejs/node#44983

* src: add missing include for `std::all_of`

nodejs/node#45541

* deps: update ICU to 72.1

nodejs/node#45068

* chore: fixup patch indices

* chore: remove errant semicolons

- nodejs/node#44179
- nodejs/node#44193

* src: add support for externally shared js builtins

nodejs/node#44376

* chore: add missing GN filenames

* deps: update nghttp2 to 1.51.0

nodejs/node#45537

* chore: disable more Node.js snapshot tests

The Snapshot feature is currently disabled

* chore: disable ICU timezone tests

Node.js uses a different version of ICU than Electron so they
will often be out of sync.

* chore: disable threadpool event tracing test

Event tracing is not enabled in embedded Node.js

* chore: fixup patch indices

* chore: comments from review

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <[email protected]>
gecko19 pushed a commit to brightsign/electron that referenced this pull request Mar 15, 2023
@electron-roller @codebytere @gecko19
chore: bump node to v18.13.0 (main) (electron#36818)
23a535e
* chore: bump node in DEPS to v18.13.0

* child_process: validate arguments for null bytes

nodejs/node#44782

* bootstrap: merge main thread and worker thread initializations

nodejs/node#44869

* module: ensure relative requires work from deleted directories

nodejs/node#42384

* src: add support for externally shared js builtins

nodejs/node#44000

* lib: disambiguate `native module` to `binding`

nodejs/node#45673

* test: convert test-debugger-pid to async/await

nodejs/node#45179

* deps: upgrade to libuv 1.44.2

nodejs/node#42340

* src: fix cppgc incompatibility in v8

nodejs/node#43521

* src: use qualified `std::move` call in node_http2

nodejs/node#45555

* build: fix env.h for cpp20

nodejs/node#45516

* test: remove experimental-wasm-threads flag

nodejs/node#45074

* src: iwyu in cleanup_queue.cc

nodejs/node#44983

* src: add missing include for `std::all_of`

nodejs/node#45541

* deps: update ICU to 72.1

nodejs/node#45068

* chore: fixup patch indices

* chore: remove errant semicolons

- nodejs/node#44179
- nodejs/node#44193

* src: add support for externally shared js builtins

nodejs/node#44376

* chore: add missing GN filenames

* deps: update nghttp2 to 1.51.0

nodejs/node#45537

* chore: disable more Node.js snapshot tests

The Snapshot feature is currently disabled

* chore: disable ICU timezone tests

Node.js uses a different version of ICU than Electron so they
will often be out of sync.

* chore: disable threadpool event tracing test

Event tracing is not enabled in embedded Node.js

* chore: fixup patch indices

* chore: comments from review

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <[email protected]>
gecko19 pushed a commit to brightsign/electron that referenced this pull request Mar 15, 2023
@electron-roller @codebytere @gecko19
chore: bump node to v18.13.0 (main) (electron#36818)
c6ae563
* chore: bump node in DEPS to v18.13.0

* child_process: validate arguments for null bytes

nodejs/node#44782

* bootstrap: merge main thread and worker thread initializations

nodejs/node#44869

* module: ensure relative requires work from deleted directories

nodejs/node#42384

* src: add support for externally shared js builtins

nodejs/node#44000

* lib: disambiguate `native module` to `binding`

nodejs/node#45673

* test: convert test-debugger-pid to async/await

nodejs/node#45179

* deps: upgrade to libuv 1.44.2

nodejs/node#42340

* src: fix cppgc incompatibility in v8

nodejs/node#43521

* src: use qualified `std::move` call in node_http2

nodejs/node#45555

* build: fix env.h for cpp20

nodejs/node#45516

* test: remove experimental-wasm-threads flag

nodejs/node#45074

* src: iwyu in cleanup_queue.cc

nodejs/node#44983

* src: add missing include for `std::all_of`

nodejs/node#45541

* deps: update ICU to 72.1

nodejs/node#45068

* chore: fixup patch indices

* chore: remove errant semicolons

- nodejs/node#44179
- nodejs/node#44193

* src: add support for externally shared js builtins

nodejs/node#44376

* chore: add missing GN filenames

* deps: update nghttp2 to 1.51.0

nodejs/node#45537

* chore: disable more Node.js snapshot tests

The Snapshot feature is currently disabled

* chore: disable ICU timezone tests

Node.js uses a different version of ICU than Electron so they
will often be out of sync.

* chore: disable threadpool event tracing test

Event tracing is not enabled in embedded Node.js

* chore: fixup patch indices

* chore: comments from review

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <[email protected]>
@ljharb

ljharb commented Jul 22, 2023

Copy link
Copy Markdown
Member

This prevents security issues, so it might be nice to backport it to 16. Any chance of that?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RaisinTen RaisinTen added the lts-watch-v16.x label Jul 24, 2023
@richardlau richardlau mentioned this pull request Aug 24, 2023
Release plan - v16.x Maintenance nodejs/Release#658
Closed
@coderabbitai coderabbitai Bot mentioned this pull request Apr 1, 2026
fix(mcp): decode escape sequences in fprobe binary params lliWcWill/fsuite#24
Merged
@coderabbitai coderabbitai Bot mentioned this pull request May 12, 2026
fix(security): address CodeQL alerts — injection, traversal, rate limiting, TOCTOU rajohan/Mira-Dashboard#23
Closed
5 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ZYSzys ZYSzys ZYSzys left review comments
@jasnell jasnell jasnell approved these changes
@bnoordhuis bnoordhuis Awaiting requested review from bnoordhuis

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. child_process Issues and PRs related to the child_process subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

child_process.spawn not checking null byte in args

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@RaisinTen @nodejs-github-bot @ljharb @bnoordhuis @jasnell @ZYSzys
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.