Repeated failed attempt rule

A repeated failed attempt rule detects a run of failed logins, failed authentications or declined transactions against one account, or from one source against many accounts, within a time window. Failures are what guessing looks like from the outside, so a cluster of them is an early signal, often before any money has moved.

The fraud scenario this rule addresses

Attackers testing stolen credentials, guessing passwords or trying card numbers generate failures before they succeed. In credential stuffing, one source tries many accounts with leaked username and password pairs, and each account sees only one or two failures. In card testing, a fraudster runs small payments with guessed card details and expiry dates, most of which are declined.

A run of failures followed by a success is the pattern most worth catching, since it suggests the guessing worked.

Data the rule requires

Example logic

Illustrative pseudocode: it compares each event with the rule's parameters and flags the ones that match. Parameters are symbolic: every value is institution-specific and has to be derived from your own transaction distribution.

RULE repeated_failed_attempts
  # Form 1: many failures against one account
  FOR EACH failed attempt F on account A:
    n = count(failures WHERE account = A
                         AND timestamp > F.timestamp - :window)
    IF n >= :max_failures_per_account:
      RAISE alert(rule = "repeated_failed_attempts", account = A)

  # Form 2: one source failing across many accounts
  FOR EACH failed attempt F from source S:
    accounts = count_distinct(failures.account WHERE source = S
                              AND timestamp > F.timestamp - :window)
    IF accounts >= :max_accounts_per_source:
      RAISE alert(rule = "repeated_failed_attempts", source = S)

  # Escalate when a success follows a run of failures
  IF success on A follows n >= :min_failures_before_success:
      RAISE alert(severity = "elevated")

Choosing a threshold

There are two forms and they need different parameters. For a single account the failure count and window must be loose enough for a customer who forgets a password and strict enough to catch scripted guessing. A low count punishes people who mistype, a high one lets a slow attacker try one guess every so often and stay below it.

The per-source form counts distinct accounts, and its limit must allow for many legitimate users sharing one network address, such as an office, a university or a mobile carrier that places thousands of customers behind a few addresses. Counting by address alone will alert on those; counting by device identifier is more precise but easier for an attacker to vary.

Treating a success after failures as a stronger signal than the failures alone is usually worth a separate parameter, because it is the point at which an attack has worked.

False positives to expect

People forget passwords, mistype a card number, use an expired card, run out of funds, or have an automatic payment retried repeatedly. A merchant's retry logic can resubmit a declined payment many times. A shared office or campus network puts many genuine users behind one address, and a customer locked out after changing a password on one device while another keeps trying the old one can produce a long run of failures.

Separating failure reasons helps considerably: a wrong password is different from an insufficient-funds decline, and counting only the reasons that indicate guessing removes a large share of the noise.

Investigating an alert from this rule

  1. Establish the shape: many failures on one account, or one source across many accounts.
  2. Check the failure reasons. Wrong credentials and unknown account point to guessing, insufficient funds does not.
  3. Check whether the attempts came from the account's usual device and network, or from an unfamiliar one.
  4. Check whether any attempt succeeded, and what the session did next, especially changes to details or payments.
  5. For a source hitting many accounts, list the accounts and look for any that were then accessed successfully.
  6. Contact affected customers if there is a success, and record the source details so repeated attempts can be recognised.

Related rules

Where this rule fits

The use case this rule supports is covered in account takeover, and the fraud rules engine page describes how conditions like these are expressed and versioned.

Common questions

What is a repeated failed attempts rule?

A repeated failed attempts rule is a fraud rule that raises an alert when an account sees a run of failed logins or declined transactions inside a time window, or when one source fails against many accounts. Failures are what credential guessing and card testing look like from outside, so a cluster is an early warning, often before any money has moved.

The two forms behave differently. Many failures on one account suggests guessing at that account, while one source failing across many accounts suggests credential stuffing, and the second form has to allow for shared networks such as offices and mobile carriers.

A success that follows a run of failures is the most important case, because it suggests the guessing worked. Counting only failure reasons that indicate guessing, rather than every decline, removes much of the noise.

Discuss your transaction monitoring requirements

Tell us which transaction flows you need to monitor, which systems Akoben would integrate with, and how your fraud team works today.

Request a demo