Skip to content
This repository has been archived by the owner on Nov 28, 2018. It is now read-only.

Not blocking IP in cidr domain range #6

Closed
nickdima opened this issue Dec 17, 2014 · 3 comments · Fixed by #7
Closed

Not blocking IP in cidr domain range #6

nickdima opened this issue Dec 17, 2014 · 3 comments · Fixed by #7

Comments

@nickdima
Copy link

Blocking IPs using cird ranges doesn't seem to work properly. It allows IPs even if they are in one of the ranges supplied.
The problem seems to be here. If you happen to set notBannedIp to true in a previous iteration of the loop, even if here allowedIp is false the function will return true here.

@ryanbillingsley
Copy link
Owner

@nickdima can you provide the configuration you are using with the middleware. I will try and create a test case around this. A sample IP would be great as well.

@nickdima
Copy link
Author

blockedIps = ['72.30.0.0/26', '127.0.0.1/24'];
app.use(ipfilter(blockedIps, {mode: 'deny', cidr: true}));

Run a server, query it from localhost and you'll see Access granted to IP address: 127.0.0.1 even though it should be blocked.

@ryanbillingsley
Copy link
Owner

@nickdima I just pushed version 0.0.18 up to fix this problem. If you are still having problems with it, let me know and I can re-open this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants