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

net: expand BlockList.PRIVATE_RANGES (unspecified, CGNAT, benchmarking)#65204
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

PRIVATE_RANGES is documented as covering private, loopback, and link-local
ranges used to block non-routable addresses. It already includes 127.0.0.0/8
and ::1/128 but omitted the IPv4 "this" network (0.0.0.0/8) and the IPv6
unspecified address (::/128), which are common alternate localhost spellings.
@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
Include RFC 6598 (100.64.0.0/10) and RFC 2544 (198.18.0.0/15) so the
helper matches common non-global IPv4 space used by carrier NAT and
benchmarking labs.
@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.30%. Comparing base (cb9bb66) to head (e8d6fba).
⚠️ Report is 228 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65204      +/-   ##
==========================================
- Coverage   90.31%   90.30%   -0.02%     
==========================================
  Files         760      760              
  Lines      248532   248540       +8     
  Branches    46908    46902       -6     
==========================================
- Hits       224467   224443      -24     
+ Misses      15505    15503       -2     
- Partials     8560     8594      +34     
Files with missing lines Coverage Δ
lib/internal/blocklist.js 94.83% <100.00%> (+0.08%) ⬆️

... and 31 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.

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

Labels

needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants