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 1604 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

Copy link
Copy Markdown
Collaborator

@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.

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants