# How to Block Automated Account Enumeration on a Login API

> Source: <https://dev.to/lialiago/how-to-block-automated-account-enumeration-on-a-login-api-3oh5>
> Published: 2026-11-28 02:07:25+00:00

**Recommendation:** Unify login error messages, status codes and response timing across existing and nonexistent accounts, and apply the same fix to registration and password-reset endpoints before adding rate limiting or CAPTCHA.
More in the playbook "Securing agents and AI tools": <https://wpnews.pro/playbooks/agent-security>

Account enumeration happens when a login API reveals whether an account exists. An attacker submits candidate email addresses or usernames, then compares error messages, status codes, response sizes, or timing. The resulting list can support credential stuffing, targeted phishing, and account takeover.

AI-assisted automation can help attackers generate candidate identities and adapt request patterns. For defenders, the practical concern is whether repeated requests reveal useful account information. This guide explains how to block automated account enumeration on a login API through application fixes, traffic controls, and verification.

SafeLine is a self-hosted WAF that filters HTTP/S traffic as a reverse proxy. Its documented capabilities include IP-based rate limiting and CAPTCHA challenges. The supplied documentation does not establish an account-enumeration detector or account-aware throttling, so treat it as one layer of the defense. [Source: SafeLine overview](https://docs.waf.chaitin.com/en/home)

Use accounts and infrastructure you control. Prepare one existing test account and one nonexistent identifier, then submit incorrect passwords to both.

Compare:

A response such as "Account not found" versus "Incorrect password" gives an attacker a direct existence signal. Identical wording can still leak information if the status code or processing time differs consistently.

Review application and edge logs for repeated login failures across many identifiers, unusually regular request intervals, and bursts concentrated on authentication endpoints. These are investigation signals, not proof by themselves. Shared networks, broken clients, and legitimate user mistakes can produce similar patterns.

Make failed authentication responses consistent for nonexistent accounts and incorrect passwords. Use a generic message such as "Invalid credentials," with consistent status codes and response structure.

Review the backend execution path as well. Returning immediately for an unknown account while performing expensive password verification for an existing one can create a timing signal. Have the application team evaluate equivalent verification work and test the outcome under realistic load.

Check registration, password reset, and account recovery too. Fixing login alone leaves enumeration possible if another endpoint confirms the same identities.

This step is essential: slowing requests does not eliminate information disclosed by each response.

Select a Linux host and verify the documented prerequisites: Docker 20.10.14 or later, Docker Compose 2.0.0 or later, and at least one CPU core, 1 GB memory, and 5 GB disk. Check the architecture and CPU requirements in the deployment guide before choosing the host. That guide also documents an ARM licensing restriction. [Source: installation requirements](https://docs.waf.chaitin.com/en/GetStarted/Deploy)

Follow the official deployment procedure. The documented automatic installer requires root privileges, so review the procedure before executing it. Once installation finishes, open `https://<safeline-ip>:9443/`. Retrieve the administrator credentials using the documented command:

```
docker exec safeline-mgt resetadmin
```

Use those credentials to sign in. [Source: installation and administrator access](https://docs.waf.chaitin.com/en/GetStarted/Deploy)

In the Web Admin Console, open "Applications" and select "Add Application." Enter the application domain, the listening port, and the upstream application address. For HTTPS applications, select the SSL option and complete the required configuration. Point the application domain to the SafeLine server's IP address. These are the documented application onboarding steps. [Source: application configuration](https://docs.waf.chaitin.com/en/GetStarted/AddApplication)

Verify a normal login through the public domain before introducing restrictions. Check that valid authentication, failed authentication, and recovery flows behave as expected.

Then check network reachability. If attackers can reach an exposed upstream directly, they may bypass the proxy. Restrict upstream access to the intended proxy path using your network controls, while preserving required operational access.

SafeLine documents IP-based rate limiting for brute-force attempts and other abuse. Establish a baseline from legitimate login traffic, then configure available rate-limiting controls conservatively and validate their scope in your deployment. The supplied sources do not specify endpoint-rule syntax or account-based counters. [Source: rate-limiting capabilities](https://docs.waf.chaitin.com/en/home)

IP limits can reduce concentrated automation, but distributed requests may remain below each address's threshold. Add application-side controls that consider account identifiers and broader failure patterns. Avoid automatic account lockouts that let attackers deny access to known users.

SafeLine also documents CAPTCHA challenges. Evaluate them for browser login flows, but test compatibility before enabling them for a JSON API used by mobile apps or service clients. A client that cannot complete an interactive challenge needs an appropriate application-level protection strategy. [Source: CAPTCHA capability](https://docs.waf.chaitin.com/en/home)

Repeat the existing-account and nonexistent-account tests after deployment. Success requires consistent failure behavior as well as reduced abusive throughput.

Run a controlled burst from authorized test infrastructure. Confirm which requests reach the application, which encounter controls, and whether legitimate clients still authenticate. SafeLine's application guide documents an attack list and a detail view; use those alongside application logs rather than assuming every enumeration attempt will appear as a detected attack. [Source: attack inspection](https://docs.waf.chaitin.com/en/GetStarted/AddApplication)

If traffic falls but account-existence differences remain, return to the application fix. If responses are consistent but distributed abuse continues, strengthen application-side throttling and investigate account-takeover signals.

No. Enumeration identifies likely valid accounts. Credential stuffing tests username and password combinations, often obtained elsewhere. The same attacker may perform both in sequence.

The supplied SafeLine documentation does not establish response normalization for this purpose. Correct account-revealing messages and behavior in the application.

Choose controls based on observed abuse and client capabilities. Frequent challenges can disrupt legitimate authentication, especially for clients without an interactive browser flow.

Look for consistent responses across account states, reduced abusive request throughput, and stable legitimate login success. A blocked-request count alone does not demonstrate that account enumeration has been prevented.

SafeLine has surpassed 700,000 installations worldwide as of September 30, 2026. SafeLine Pro annual promotional pricing is $650-$880, compared with the regular $1,000 per year.
