-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BlockList addRange appears to match addresses incorrectly #39074
Labels
net
Issues and PRs related to the net subsystem.
Comments
@targos Is this a relevant bug ? |
Will investigate! |
Thank you for looking into this 👍 |
foxxyz
pushed a commit
to foxxyz/node
that referenced
this issue
Oct 18, 2021
This commit updates compare_ipv4() to use the host byte order. PR-URL: nodejs#39096 Fixes: nodejs#39074 Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
v16.3.0
Darwin <redacted> 20.4.0 Darwin Kernel Version 20.4.0: Thu Apr 22 21:46:41 PDT 2021; root:xnu-7195.101.2~1/RELEASE_ARM64_T8101 arm64
net
What steps will reproduce the bug?
I've used the following code snippet from Node.JS Net docs to try to block IPs based on ranges:
How often does it reproduce? Is there a required condition?
Always reproduces.
What is the expected behavior?
I expect the block list with above-mentioned configuration to block
10.0.0.3
but allow192.168.0.3
(i.e.,check
to returnfalse
).What do you see instead?
It looks as if
BlockList
matches only the last element of the IP address. As a result,check
returnstrue
for192.168.0.3
even though it's not in the range:Additional information
addAddress
and (more importantly)addSubnet
appears to work fine:The text was updated successfully, but these errors were encountered: