cloudpanel-io / cloudpanel-ce

1.28k stars 106 forks source link

CIDR notation is not supported in IP Blocking in the GUI #409

Open elmanuel127 opened 9 months ago

elmanuel127 commented 9 months ago

CloudPanel version(s) affected

2.4.1

Description

CIDR notation for IP blocking is not supported in the GUI.

The help text in the menu hints that CIDR notation is supported but only single IPs are supported in blocking.

How to reproduce

Add a CIDR notation to the end of an IP and that IP will be allowed to view the site instead of being denied.

Possible Solution

No response

Additional Context

No response

cloudpanel-io commented 9 months ago

Confirmed. It's a bug and can be reproduced.

The generated if condition in the vhost only works for single IPs:

if ($remote_addr ~ "^(192.168.0.1/32)$") { return 403; }