How to Block Automated Account Enumeration on a Login API
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
1. Establish what the login API reveals
Use accounts and infrastructure you control. Prepare one existing test account and one nonexistent identifier, then submit incorrect passwords to both. Compare:
- HTTP status codes and response bodies.
- Error wording, response length, and redirect behavior.
- Cookies and other response headers.
- Response timing across repeated samples.
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.
2. Remove the account-existence signal
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.
3. Prepare and install SafeLine
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
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
4. Route the application through SafeLine
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
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.
5. Choose controls that match the client
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
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
6. Validate both information leakage and abuse reduction
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
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.
Frequently asked questions
Is account enumeration the same as credential stuffing? No. Enumeration identifies likely valid accounts. Credential stuffing tests username and password combinations, often obtained elsewhere. The same attacker may perform both in sequence.
Can a WAF fix different login error messages? The supplied SafeLine documentation does not establish response normalization for this purpose. Correct account-revealing messages and behavior in the application.
Should every failed login trigger a CAPTCHA? Choose controls based on observed abuse and client capabilities. Frequent challenges can disrupt legitimate authentication, especially for clients without an interactive browser flow.
What evidence shows the defense is working? 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.
SafeLine website: https://ly.cyberserval.tech/bvK1BAV
Demo: https://demo.waf.chaitin.com:9443/statistics
Official docs: https://docs.waf.chaitin.com/en/home
GitHub: https://github.com/chaitin/SafeLine
Pro offer: https://cyberserval.tech/landing/lto
Comments
No comments yet. Start the discussion.