Skip to content

net: expand BlockList.PRIVATE_RANGES (unspecified, CGNAT, benchmarking) - #65204

Open
SashaMIT wants to merge 2 commits into
nodejs:mainfrom
SashaMIT:fix/blocklist-private-ranges-unspecified
Open

SashaMIT wants to merge 2 commits into
nodejs:mainfrom
SashaMIT:fix/blocklist-private-ranges-unspecified

Conversation

@SashaMIT

Copy link
Copy Markdown

Summary

BlockList.PRIVATE_RANGES is documented as a convenience list of private, loopback, and link-local ranges for blocking non-routable addresses. It already includes 127.0.0.0/8 and ::1/128, but omitted:

  • 0.0.0.0/8 (IPv4 "this" network / unspecified; common alternate localhost spelling)
  • ::/128 (IPv6 unspecified)

Callers who populate a blocklist from PRIVATE_RANGES alone would still treat 0.0.0.0 and :: as allowed.

Test plan

  • Extended test/parallel/test-blocklist.js PRIVATE_RANGES coverage for 0.0.0.0, 0.0.0.1, and ::
  • Docs list updated in doc/api/net.md

This API is unreleased (added: REPLACEME), so this is a constants/docs completion rather than a HackerOne report.

Made with Cursor

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Aug 11, 2026
@SashaMIT

Copy link
Copy Markdown
Author

Follow-up commit on this branch: also include RFC 6598 CGNAT (100.64.0.0/10) and RFC 2544 benchmarking (198.18.0.0/15) in BlockList.PRIVATE_RANGES, with tests for 100.64.0.1 / 198.18.0.1.

Same unreleased-API helper surface as the 0.0.0.0/8 + ::/128 additions already in this PR.

@SashaMIT SashaMIT changed the title net: include 0.0.0.0/8 and ::/128 in BlockList.PRIVATE_RANGES net: expand BlockList.PRIVATE_RANGES (unspecified, CGNAT, benchmarking) Aug 11, 2026
@codecov

codecov Bot commented Aug 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.68%. Comparing base (cb9bb66) to head (14f0973).
⚠️ Report is 2138 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65204      +/-   ##
==========================================
+ Coverage   90.31%   90.68%   +0.36%     
==========================================
  Files         760      797      +37     
  Lines      248532   279582   +31050     
  Branches    46908    53781    +6873     
==========================================
+ Hits       224467   253530   +29063     
- Misses      15505    16343     +838     
- Partials     8560     9709    +1149     
Files with missing lines Coverage Δ
lib/internal/blocklist.js 97.24% <100.00%> (+2.49%) ⬆️

... and 468 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aduh95 aduh95 added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Nov 2, 2026
@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 Nov 2, 2026
@nodejs-github-bot

This comment was marked as outdated.

@MikeMcC399

This comment was marked as resolved.

PRIVATE_RANGES covers private, loopback, and link-local ranges.
It already includes 127.0.0.0/8 and ::1/128, and left out the
IPv4 "this" network (0.0.0.0/8) and the IPv6 unspecified
address (::/128). Those are common localhost spellings.

Signed-off-by: Sasha Mitchell <sash.t.mitchell@gmail.com>
Include RFC 6598 (100.64.0.0/10) and RFC 2544 (198.18.0.0/15).
The helper then matches the non-global IPv4 space used by
carrier NAT and benchmarking labs.

Signed-off-by: Sasha Mitchell <sash.t.mitchell@gmail.com>
@SashaMIT
SashaMIT force-pushed the fix/blocklist-private-ranges-unspecified branch from e8d6fba to 14f0973 Compare November 7, 2026 16:56
@SashaMIT

SashaMIT commented Nov 7, 2026

Copy link
Copy Markdown
Author

Thanks for the pointer. Both commits are signed off and the body lines are wrapped to 72 columns. The tip is 14f0973.

@jasnell jasnell added request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. semver-minor PRs that contain new features and should be released in the next minor version. labels Nov 29, 2026
@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 Nov 29, 2026
@nodejs-github-bot

This comment was marked as outdated.

@MikeMcC399 MikeMcC399 added the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 30, 2026
@github-actions github-actions Bot removed the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 30, 2026
@nodejs-github-bot

This comment was marked as outdated.

@Ethan-Arrowood

Copy link
Copy Markdown
Contributor

I do believe "This API is unreleased (added: REPLACEME), so this is a constants/docs completion rather than a HackerOne report." part of the description is no longer true. Can you update the PR description to be up to date with the latest state of the changes?

@Ethan-Arrowood Ethan-Arrowood left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm fine with this, but I think since PRIVATE_RANGES shipped in v26.8.0 and v24.21.0 we might need to consider this a major change now?

@Ethan-Arrowood Ethan-Arrowood removed the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Dec 2, 2026
@jasnell jasnell added dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v24.x PRs that should not land on the v24.x-staging branch and should not be released in v24.x. dont-land-on-v26.x PRs that should not land on the v26.x-staging branch and should not be released in v26.x. labels Dec 3, 2026
@jasnell

jasnell commented Dec 3, 2026

Copy link
Copy Markdown
Member

hm... I think this would be fine as a semver-minor. Could be convinced it's a major. How about we add don't land labels for now?

@jasnell jasnell 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 Dec 3, 2026
@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 Dec 3, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v24.x PRs that should not land on the v24.x-staging branch and should not be released in v24.x. dont-land-on-v26.x PRs that should not land on the v26.x-staging branch and should not be released in v26.x. needs-ci PRs that need a full CI run. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants