Your reverse proxy logs show thousands of POST /login requests, all returning 200 OK. You grep for 401 or 403 to find brute-force attempts and find almost nothing. Everything looks clean. Meanwhile, accounts are getting taken over. The problem: many web applications return HTTP 200 for both successful and failed login attempts. The status code alone tells you nothing about what actually happened.
This is not a rare edge case. Frameworks like Django, Laravel, WordPress, and many custom apps render the login form again with an error message on failure — still a 200. A successful login might also return 200 before issuing a client-side redirect via JavaScript. If your monitoring pipeline counts status codes and nothing else, credential stuffing attacks are invisible.
Why status codes hide credential stuffing
Credential stuffing differs from brute force. Attackers use stolen username-password pairs from other breaches, rotate through thousands of IPs (residential proxies, botnets, cloud instances), and keep request volume per IP low enough to stay under WAF and fail2ban thresholds. For more on that pattern, see Reverse Proxy Logs Show No Brute Force but Accounts Keep Getting Taken Over? Check for Low-and-Slow ATO.
When every attempt returns 200, rate-limiting by status code is useless. You need a different signal. Three signals are available in standard reverse proxy access logs without touching application code: response body size, redirect behavior, and Set-Cookie presence.
Step 1: Find the body-size split in your logs
A failed login typically returns the login page again, complete with the form HTML, error message, and all the markup. A successful login often returns either a smaller redirect page, a larger dashboard page, or a 302 redirect with a tiny body. The point is: the byte count differs.
First, extract body sizes for all POST /login (or whatever your login path is) requests that returned 200. In a standard Nginx combined log format or Apache combined format, the response body size is typically the field after the status code.
# Extract status code and body size for POST requests to /login
# Adjust field positions if your log format differs
awk '6 ~ /POST/ &&7 ~ /\/login/ && 9 == 200 {print10}' /var/log/nginx/access.log | sort -n | uniq -c | sort -rn | head -20
This prints a frequency table of response body sizes. Illustrative output format:
8423 4892
312 4910
47 1843
12 1851
3 2204
In this illustrative example, the vast majority of 200 responses have a body around 4892 bytes — that cluster is your failed logins (the login page re-rendered with an error). The smaller cluster around 1843 bytes might be successful logins returning a redirect stub or a different page. The exact numbers depend entirely on your application.
What matters is finding two distinct clusters. If you see one dominant size and a handful of outliers, the outliers are worth investigating — they likely represent successful authentications.
Step 2: Correlate the outlier sizes with IPs and usernames
Once you know which body size means "success," pull the IPs that received those responses.
# Find IPs that got the smaller (successful) response body
# Replace 1843 with whatever your success body size is
awk '6 ~ /POST/ &&7 ~ /\/login/ && 9 == 200 &&10 >= 1840 && 10 <= 1860 {print1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head -20
If a single IP has dozens of successful logins to different accounts, that is credential stuffing that worked. If thousands of IPs each have one successful login, that is distributed credential stuffing — harder to catch by IP alone, but the body-size filter still surfaces the successful attempts.
Compare this against your application's auth logs (if available) to confirm which usernames were involved. The reverse proxy log typically does not contain the username in the default format, but the timestamp correlation between the access log and the application log narrows it down.
Step 3: Check redirect targets for 302 responses
Some applications do return 302 on successful login and 200 on failure. If yours does, you are in better shape — but you still need to verify where the redirect points. An attacker who gets a valid session might receive a 302 to /dashboard while a failure gets a 302 back to /login.
Nginx does not log the Location header by default. You can add it to your log format:
In your Nginx config, define a custom log format that includes sent_http_location. The exact directive depends on your setup, but the key variable is sent_http_location for Nginx. For Apache, %{Location}o captures outgoing Location headers. After adding this, grep for 302 responses on your login endpoint and check whether the Location header points to a post-login page or back to the login form.
This distinction — redirect-to-dashboard versus redirect-to-login — is your success/failure signal when the status code is 302 in both cases.
Step 4: Look for Set-Cookie as a success indicator
Successful logins almost always set a session cookie. Failed logins typically do not, or they set a different, shorter-lived cookie (like a CSRF token refresh). If you can log whether a Set-Cookie header was present in the response, you have another reliable signal.
Neither Nginx nor Apache log response headers by default. For Nginx, $sent_http_set_cookie captures the Set-Cookie header value. You probably do not want to log the full cookie value (it contains the session token), so a common approach is to log just its presence or length. Some setups use a map directive to convert the header into a boolean flag before writing it to the log.
Once you have this in your logs, the query is straightforward: any POST /login that returned 200 and included a Set-Cookie header with a session cookie name is a successful login. Cross-reference those with the body-size analysis from Step 1 to double-check your findings.
Step 5: Build a baseline, then alert on deviations
Run the body-size frequency analysis from Step 1 during a known-quiet period to establish what normal looks like. Note the typical ratio of failed-to-successful logins. On most sites, failed logins outnumber successful ones, but not by a factor of hundreds to one.
If your daily ratio suddenly shifts — say the number of "success-sized" responses spikes from a handful to hundreds — something changed. Either a marketing campaign drove real signups, or someone is stuffing credentials that work.
A simple cron job that runs the awk one-liner daily and compares counts against a threshold is a low-effort first step. More sophisticated setups pipe these metrics into monitoring tools, but the core detection logic is the same: count responses by body size, not by status code.
What this does not cover
Body-size analysis works when your application returns meaningfully different page sizes for success and failure. If your app returns identical byte counts for both (rare, but possible with single-page apps that handle everything client-side via JavaScript with identical initial HTML shells), you need application-level logging instead. In that case, the app must emit a structured log entry distinguishing success from failure, and your detection pipeline reads that log rather than the reverse proxy access log.
Also, attackers who know you monitor body size can pad requests or use techniques to normalize response sizes. This is uncommon in commodity credential stuffing but worth knowing about. Defense in depth still matters — this technique supplements rate limiting and WAF rules, it does not replace them.
For more on how credential stuffing tools evade standard defenses, see How OpenBullet Credential Stuffing Bypasses WAF and What Logs Actually Reveal.
The practical takeaway: stop treating 200 OK as a single bucket. Run the body-size frequency query against your login endpoint today. If you see two distinct clusters, you now know which one means "someone got in." That ten-minute check surfaces compromises that status-code monitoring misses entirely.