net: fix BlockList.fromJSON for IPv4-mapped IPv6 rules · nodejs/node@c93a90c · GitHub
Skip to content

Commit c93a90c

Browse files
watildeaduh95
authored andcommitted
net: fix BlockList.fromJSON for IPv4-mapped IPv6 rules
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> PR-URL: #64125 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <richard.lau@ibm.com>
1 parent 4876627 commit c93a90c

2 files changed

Lines changed: 40 additions & 3 deletions

File tree

‎lib/internal/blocklist.js‎

Lines changed: 3 additions & 3 deletions

‎test/parallel/test-blocklist.js‎

Lines changed: 37 additions & 0 deletions

0 commit comments

Comments
 (0)