Skip to content
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

Invalid IP #188

Open
arwinvdv opened this issue Mar 29, 2023 · 0 comments
Open

Invalid IP #188

arwinvdv opened this issue Mar 29, 2023 · 0 comments

Comments

@arwinvdv
Copy link

In our laravel application we added this:

if (app('firewall')->isBeingAttacked()) {
    return app('firewall')->responseToAttack();
}

But with some attacks we got a exception like InvalidArgumentException: The value ""{${print(9347655345-4954366)}}"" is not a valid IP address. in /../vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php:175

We surround it with

try {
    // Check if user is attacking server
    if (app('firewall')->isBeingAttacked()) {
        return app('firewall')->responseToAttack();
    }
} catch (InvalidArgumentException) {
    return app('firewall')->responseToAttack();
}

But than we got an error exception like ErrorException: Trying to access array offset on value of type null in /.../vendor/pragmarx/firewall/src/Support/AttackBlocker.php:272

I replaced the catch return with an abort() now, but is there a better way to handle this?

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

No branches or pull requests

1 participant