Skip to content

net: fix BlockList.fromJSON for IPv4-mapped IPv6 rules - #64125

Open
watilde wants to merge 1 commit into
nodejs:mainfrom
watilde:fix/blocklist-fromjson-ipv4-mapped-ipv6
Open

net: fix BlockList.fromJSON for IPv4-mapped IPv6 rules#64125
watilde wants to merge 1 commit into
nodejs:mainfrom
watilde:fix/blocklist-fromjson-ipv4-mapped-ipv6

Conversation

@watilde

@watilde watilde commented Jun 25, 2026

Copy link
Copy Markdown
Member

BlockList.toJSON() serializes IPv4-mapped IPv6 addresses in mixed dotted-quad form (e.g. "::ffff:192.0.2.128"), but the fromJSON() rule parser's IPv6 regexes excluded "." and capped the length at 39, so such rules were silently corrupted or dropped on a toJSON()/fromJSON() round-trip. Allow "." and raise the cap to 45 (the longest mixed form).

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Jun 25, 2026
@watilde watilde added request-ci Add this label to start a Jenkins CI on a PR. review wanted PRs that need review. labels Jun 29, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@panva panva removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 28, 2026
@jasnell

jasnell commented Aug 29, 2026

Copy link
Copy Markdown
Member

@watilde ... can I ask you to rebase this so we can get it landed :-)

BlockList.toJSON() serializes IPv4-mapped IPv6 addresses in mixed
dotted-quad form (e.g. "::ffff:192.0.2.128"), but the fromJSON() rule
parser's IPv6 regexes excluded "." and capped the length at 39, so such
rules were silently corrupted or dropped on a toJSON()/fromJSON()
round-trip. Allow "." and raise the cap to 45 (the longest mixed form).

Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
@watilde
watilde force-pushed the fix/blocklist-fromjson-ipv4-mapped-ipv6 branch from 265bda4 to f06e1c1 Compare August 29, 2026 15:19
@watilde

watilde commented Aug 29, 2026

Copy link
Copy Markdown
Member Author

@jasnell Done!

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.06%. Comparing base (789c7fd) to head (f06e1c1).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #64125   +/-   ##
=======================================
  Coverage   90.05%   90.06%           
=======================================
  Files         754      754           
  Lines      255727   255727           
  Branches    48320    48332   +12     
=======================================
+ Hits       230300   230317   +17     
+ Misses      16552    16543    -9     
+ Partials     8875     8867    -8     
Files with missing lines Coverage Δ
lib/internal/blocklist.js 97.14% <100.00%> (+2.44%) ⬆️

... and 32 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. review wanted PRs that need review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants