Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: validate custom lookup() output #34813

Closed
wants to merge 1 commit into from
Closed

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Aug 17, 2020

This commit adds validation to the IP address returned by the
net module's custom DNS lookup() function.

Fixes: #34812

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@cjihrig cjihrig requested a review from a team as a code owner August 17, 2020 19:02
@cjihrig cjihrig requested a review from a team August 17, 2020 19:02
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/net
  • @nodejs/quic

@nodejs-github-bot nodejs-github-bot added the net Issues and PRs related to the net subsystem. label Aug 17, 2020
Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

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

Is this testable? :)

@jasnell
Copy link
Member

jasnell commented Aug 17, 2020

@addaleax:

Is this testable?

Yeah, see @cjihrig's comment in the original post:

I'll add a test later tonight when I have more time.

The current failure is an assertion failure, so a simple test that ensures that an error event occurs rather than a crash should be sufficient. A basic test case is already provided in the original issue.

This commit adds validation to the IP address returned by the
net module's custom DNS lookup() function.
@cjihrig
Copy link
Contributor Author

cjihrig commented Aug 18, 2020

Is this testable? :)

Test added!

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@rickyes rickyes added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 18, 2020
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 18, 2020
@cjihrig
Copy link
Contributor Author

cjihrig commented Aug 19, 2020

@cjihrig cjihrig added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Aug 19, 2020
@jasnell jasnell added the fast-track PRs that do not need to wait for 48 hours to land. label Aug 19, 2020
@jasnell
Copy link
Member

jasnell commented Aug 19, 2020

Fast track? please 👍🏻

@jasnell jasnell added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 19, 2020
@github-actions github-actions bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 19, 2020
@github-actions
Copy link
Contributor

Landed in 24cc4a6

@github-actions github-actions bot closed this Aug 19, 2020
nodejs-github-bot pushed a commit that referenced this pull request Aug 19, 2020
This commit adds validation to the IP address returned by the
net module's custom DNS lookup() function.

PR-URL: #34813
Fixes: #34812
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@cjihrig cjihrig deleted the ip branch August 19, 2020 19:26
addaleax pushed a commit that referenced this pull request Sep 22, 2020
This commit adds validation to the IP address returned by the
net module's custom DNS lookup() function.

PR-URL: #34813
Fixes: #34812
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
addaleax pushed a commit that referenced this pull request Sep 22, 2020
This commit adds validation to the IP address returned by the
net module's custom DNS lookup() function.

PR-URL: #34813
Fixes: #34812
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@codebytere codebytere mentioned this pull request Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. fast-track PRs that do not need to wait for 48 hours to land. net Issues and PRs related to the net subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Coredump when passing undefined as address from custom lookup function
10 participants