Skip to content

[limiter] Rate limiting does not work #1237

Description

@mrpaulblack

Version of SearXNG, commit number if you are using on master branch and stipulate if you forked SearXNG

Leons instance: 2022.05.24-fddbc5ed (39077fc0)
ALso my instance: 2022.05.08-85c1c14f 

How did you install SearXNG?

Using the scripts as well as with docker.

What happened?

The limiter plugin does not rate limit requests and uses the X-Forwarded-For header which could be easily set by a client request.

How To Reproduce
Make 15 /search requests in 20sec to trigger rate limiting.
Make another search request, which is going to get blocked with a HTTP 429 response.
Make another /search request which is going to get not blocked again.

Expected behavior
The IP should get blocked for a specific amount of time with a timeout value for example. So a offending host could get blocked for like 2 hours for example.

Screenshots & Logs

Additional context
Another problem is that the IP is read from a header. In a improper setup the IP could maybe not be in that header or a client could abuse this and set the header themselves. The IP should be gotten from a trusted source... (Maube the request lib has something to get the IP?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status
    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions