akaunting / laravel-firewall

Web Application Firewall (WAF) package for Laravel
https://akaunting.com
MIT License
943 stars 106 forks source link

Issues when deleting blocked ip without clearing logs #23

Closed lucabartoli closed 4 years ago

lucabartoli commented 4 years ago

If someone unblock an ip without clearing all logs, the block counter doesn't work anymore, as it checks for neq only. This could also lead to some issues created by many concurrent requests (not tested). I think it's simply safer to check for "less than" instead of "not equal to".

https://github.com/akaunting/firewall/blob/2a20b4fd2bb388f498a8e1e82878ac6be6dfa1f0/src/Listeners/BlockIp.php#L27-L27

denisdulici commented 4 years ago

Feel free to send a PR.