fix(ext/node): fix send() validation in child_process IPC#32779
Merged
bartlomieju merged 3 commits intodenoland:mainfrom Mar 17, 2026
Merged
fix(ext/node): fix send() validation in child_process IPC#32779bartlomieju merged 3 commits intodenoland:mainfrom
bartlomieju merged 3 commits intodenoland:mainfrom
Conversation
Two validation issues in the IPC send() function:
1. Used `new TypeError("ERR_MISSING_ARGS")` instead of the proper
`ERR_MISSING_ARGS` error class, so the error had the code as its
message instead of the correct message and code properties.
2. Missing type validation for the message argument. Sending a Symbol
would hit the IPC serializer and throw an internal error instead of
the expected ERR_INVALID_ARG_TYPE. Now validates that message is
string, object, number, or boolean before attempting to send.
nathanwhit
reviewed
Mar 16, 2026
| ) { | ||
| throw new ERR_INVALID_ARG_TYPE( | ||
| "message", | ||
| ["string", "object", "number", "boolean"], |
Member
There was a problem hiding this comment.
Does this also apply to advanced serialization? I was under the impression advanced serialization works on every type
Member
There was a problem hiding this comment.
Yes, this validation applies to both modes in Node.js. Even with advanced serialization, Node.js rejects Symbol at the send() level before it reaches the serializer. V8's ValueSerializer also can't serialize Symbols. So the PR's approach is correct for both modes — but the bigint handling needs clarification since advanced serialization can handle BigInt (via BigInt64Array etc.) while JSON serialization cannot.
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.
Two validation issues in the IPC send() function:
Used
new TypeError("ERR_MISSING_ARGS")instead of the properERR_MISSING_ARGSerror class, so the error had the code as its message instead of the correct message and code properties.Missing type validation for the message argument. Sending a Symbol would hit the IPC serializer and throw an internal error instead of the expected ERR_INVALID_ARG_TYPE. Now validates that message is string, object, number, or boolean before attempting to send.