8000 [Security] login_throttling un-blocking for *one* attempt at "5 * max_attempts" · Issue #47282 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Security] login_throttling un-blocking for *one* attempt at "5 * max_attempts" #47282
Closed
@ThomasLandauer

Description

@ThomasLandauer

Symfony version(s) affected

6.1.3

Description

I have this in my security.php:

$security->provider('foo_provider')->entity()->class(Foo::class)->property('token');
$mainFirewall->loginThrottling()->maxAttempts(1)->interval('1 hour');

Foo::$token is a self-created random string for magic link login.

This happens when requesting the same inexistent token URL (after cache:clear):

  1. attempt => "Invalid link"
  2. attempt => "You're blocked" // As expected with ->maxAttempts(1)
  3. attempt => "You're blocked"
  4. attempt => "You're blocked"
  5. attempt => "Invalid link" // Why??
  6. through 20. attempt => "You're blocked"

So to me this looks like either a bug, or the documentation at https://symfony.com/doc/5.4/security.html#limiting-login-attempts is missing something:

Login attempts are limited on max_attempts (default: 5) failed requests for IP address + username and 5 * max_attempts failed requests for IP address.

When changing max_attempts to 2, the unexptected "Invalid link" happens at the 10th attempt, so it's probably related to the "5 * max_attempts" rule.

How to reproduce

If you're telling me that this is the expected behavior, then let's try to improve the docs. If you say that this is unexpected, I can try to investigate it further or create a reproducer.

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0