Skip to content

Invalid IP #188

@arwinvdv

Description

@arwinvdv

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions