Welcome back! In our last lesson, you learned to identify the key authentication patterns used in modern web applications: API Keys, JWTs, and OAuth/OIDC. You now have the skills to look at an API request and understand how the application is trying to prove a user's identity.
Today, we move from identification to exploitation. This lesson focuses on the learning outcome: Analyze authentication flows to identify weaknesses such as insecure credential handling and lack of rate limiting. We will dissect these authentication flows to find the subtle but critical flaws that can lead to account takeover.
We will cover two major classes of vulnerabilities:
- Insecure Credential Handling: This goes beyond just checking for HTTPS. We'll explore logical flaws in the authentication process where you can manipulate requests or exploit insecure configurations to bypass login mechanisms entirely.
- Lack of Rate Limiting: We'll examine what happens when an application doesn't limit the number of authentication attempts, opening the door to brute-force attacks and other denial-of-service vectors.
By the end of this lesson, you'll be able to actively probe a login flow for these common and impactful security holes.
1. Insecure Credential Handling: Finding the Cracks in the Armor
A secure authentication flow is more than just a strong password policy. The entire process of exchanging credentials for a session must be robust. Flaws often hide in the logic of how the server processes login requests.
A common mistake developers make is placing too much trust in client-side parameters. For example, a login API might return a simple {"authenticated": false} message, and the client-side code is expected to handle it. What if a savvy attacker intercepts that request and manipulates it?
Let's watch a segment that demonstrates a real-world bug bounty report where an attacker achieved a full account takeover simply by changing a false value to true in a login request. This is a perfect illustration of a critical logic flaw.
Top 5 API Vulnerabilities That Pay in Bug Bounties
The video 'Top 5 API Vulnerabilities That Pay in Bug Bounties' by Medusa provides an excellent example of a broken authentication flow. This segment highlights how a simple parameter manipulation can lead to a complete bypass.
Watch the section on 'Broken Authentication' from 04:00 to 07:31. Pay close attention to the bug bounty report walkthrough, where the presenter analyzes how an attacker bypassed the login by modifying a boolean value in the request.
Bypassing Authentication with Parameter Manipulation
The example in the video is a stark reminder that even the most complex applications can have simple, devastating flaws. The core technique demonstrated—modifying request parameters to bypass a control—is a fundamental skill in web penetration testing.
For a more hands-on, step-by-step guide, let's turn to a practical recipe using Burp Suite. The following reading will show you how to capture both an unauthenticated and an authenticated request, compare them to find the key differences (like session cookies and headers), and then replay the unauthenticated request with the authenticated values to bypass the login page.
The 'Burp Suite Cookbook' provides a clear, practical recipe for bypassing an authentication scheme using parameter modification. This exercise will solidify the concept of replaying requests with modified headers to gain unauthorized access.
Read the chapter 'Assessing Authentication Schemes' and focus on the recipe named 'Testing for bypassing authentication schemes'. Follow the steps that demonstrate how to use Burp Repeater and Comparer to copy authenticated session information into an unauthenticated request.
Case Study: Insecure Handling in OAuth 2.0 Flows
In the previous lesson, we saw that OAuth 2.0 is a complex framework for delegated authorization. Its complexity can often introduce unique vulnerabilities if not implemented perfectly. A common flaw is an open redirect vulnerability in the redirect_uri parameter. If the server doesn't strictly validate this URI, an attacker can trick a user into sending their secret authorization code or access_token to a malicious server. This is a prime example of insecure credential handling within a complex flow.
Let's revisit the video on OAuth to see a practical demonstration of this attack.
Mastering OAuth 2.0 Flows: Complete Guide + Security Testing Tips (Okta OAuth Playground)
Returning to Medusa's 'Mastering OAuth 2.0 Flows' video, we will now focus on specific vulnerabilities in the Authorization Code Flow. This will connect our previous lesson on identifying OAuth with today's topic of exploiting it.
Watch the section on the 'Authorization Code Flow' from 09:10 to 16:05. Focus on the two bug bounty reports discussed: one involving a simple open redirect and the other, a more advanced path traversal in the redirect_uri to steal the authorization code.
2. Lack of Rate Limiting: The Brute's Best Friend
Rate limiting is a control that restricts how many times a user can repeat an action within a specific timeframe. In the context of authentication, it's the primary defense against automated password guessing attacks.

When an application fails to implement rate limiting on its login page, password reset form, or 2FA/OTP verification endpoint, it becomes highly vulnerable.
Types of Attacks Enabled by Missing Rate Limits
- Brute-Force Attacks: Systematically trying all possible passwords for a known username.
- Password Spraying: Trying one common password (e.g.,
Password123) against a large list of usernames. - Credential Stuffing: Using lists of usernames and passwords stolen from other data breaches to try and log in.
- Denial of Service (DoS): Overloading the login endpoint with requests can consume server resources (CPU, memory), making the service unavailable for legitimate users.
- Economic DoS: For APIs that rely on paid third-party services (e.g., sending an SMS for OTP), an attacker can generate a massive number of requests to drive up costs for the target company.
The following video section explains these concepts with clear examples, including how manipulating an API parameter like page size can lead to a DoS condition.
Top 5 API Vulnerabilities That Pay in Bug Bounties
Let's return to the 'Top 5 API Vulnerabilities' video to explore the impact of missing rate limits.
Watch the segment 'Lack of rate limiting' from 09:46 to 13:24. Notice the distinction between rate limiting in traditional web apps (preventing brute-force) and in APIs (preventing economic DoS and resource exhaustion).
Testing for Weak Lockout Mechanisms
The most basic test for rate limiting is simple: try to log in with a valid username and an incorrect password several times in a row. Does the application lock you out after 3, 5, or 10 attempts? Does it present a CAPTCHA? Or does it let you try indefinitely?
The reading below provides a hands-on recipe for testing this and then using Burp Intruder to perform a basic brute-force attack once you've confirmed that no lockout mechanism is in place.
The 'Burp Suite Cookbook' offers another practical recipe, this time for identifying and exploiting weak account lockout mechanisms, which is a direct consequence of poor rate limiting.
In the same chapter as before, now read the recipe 'Testing for weak lock-out mechanisms'. Pay attention to how to manually check for a lockout policy and then configure Burp Intruder for a simple password guessing attack.
Advanced Case Study: Bypassing Rate Limits at OpenAI
Rate limiting isn't always as simple as counting requests from an IP address. Sophisticated systems use more complex logic, and bypassing them requires more than just sending requests quickly. The following blog post details a fascinating bug found in ChatGPT where a server architecture quirk—HTTP Request Tunneling—allowed the researcher to bypass the API's rate limits, even when a standard high-speed attack failed. This is a great example of the advanced, logic-based bypasses you should aim to find.
Advanced API Attacks in ChatGPT
This blog post from Huntr, 'Advanced API Attacks in ChatGPT', details a real-world, advanced rate limit bypass. It's an excellent case study on how to look for anomalies and exploit architectural weaknesses.
Read the sections 'Anomaly Hunting in Applications', 'Drilling Down to the Details', and 'Rate Limit Bypass'. Focus on the methodology: spotting an unusual response in Burp Logger, simplifying the request to understand the root cause (HTTP Request Tunneling), and then weaponizing that finding to bypass the rate limit control.
Test your understanding!
You are testing a mobile application's login flow. You capture the traffic in Burp Suite and observe the following POST request to /api/v2/login when you enter an incorrect password:
Request Body:
{
"username": "testuser",
"password": "wrongpassword123"
}
Response Body:
{
"success": false,
"error": "Invalid credentials provided."
}
-
You try submitting incorrect passwords 20 times in 30 seconds, and you receive the same response each time without being blocked or slowed down. What specific vulnerability does this indicate?
-
While replaying the request in Burp Repeater, you decide to add a new key-value pair to the JSON body:
"login_as_admin": true. You send the request and receive a200 OKresponse with an admin session token. What class of vulnerability does this represent?
Show answer
-
This indicates a lack of rate limiting (or a weak account lockout mechanism). The application is not preventing or discouraging automated brute-force attacks against user accounts. An attacker could use a tool like Burp Intruder or Hydra to guess passwords for
testuserindefinitely. -
This is a form of insecure credential handling, specifically an authentication bypass through parameter manipulation. The developers incorrectly trusted a client-supplied parameter (
login_as_admin) in their authentication logic, allowing an attacker to escalate privileges and bypass the standard password check entirely.
Conclusion
In this lesson, you've moved from simply identifying authentication systems to actively probing them for critical weaknesses. You now understand that a secure login process is not a given; it must be carefully implemented and rigorously tested.
Key Takeaways:
- Insecure Credential Handling is often a logic flaw. Always test for parameter manipulation that could alter the authentication decision, and be especially wary of complex flows like OAuth, where misconfigurations (like an insecure
redirect_uri) can leak sensitive tokens. - Lack of Rate Limiting is a gift to attackers. The absence of account lockout policies or request throttling on login endpoints directly enables brute-force, password spraying, and credential stuffing attacks.
- Analyze, Don't Assume: Never assume an authentication flow is secure just because it uses a standard protocol. Look for anomalies, test edge cases, and question every parameter the client sends to the server.
Next Lesson Preview:
In this lesson, we saw how an application's responses (e.g., "Invalid credentials") can be part of the attack flow. Our next lesson, Perform username enumeration by analyzing application error messages and response timing, will dive deeper into this concept. You will learn how to exploit subtle differences in application responses to build a list of valid usernames, which is the first step in any targeted brute-force or password spraying attack.