Hello! Welcome back to our module on Authorization Bypass & Logic Flaws.
In our last lesson, we focused on manipulating the data within an application's workflow, such as changing prices or quantities to trick the business logic. We learned that an application's greatest weakness can be its own rules.
Today, we take that concept a step further. Instead of just changing the values within a step, we're going to see if we can bypass the steps themselves. This lesson directly addresses the learning outcome: Test application workflows for bypass vulnerabilities that allow skipping critical steps.
These are some of the most impactful (and rewarding) vulnerabilities to find, often leading to critical findings like getting products for free or bypassing security checks. This is where your ability to think like an attacker, unconstrained by the UI, truly shines.
1. The Root Cause: Flawed Assumptions About User Behavior
The fundamental reason workflow bypass vulnerabilities exist is that developers make a critical, yet common, assumption: that a user will follow the intended sequence of actions dictated by the user interface. They build a multi-step process—like a checkout flow or a password reset mechanism—expecting a linear progression.
An attacker, however, is not bound by the UI. With a tool like Burp Suite, you can capture, modify, and resend any request in any order you choose.
To understand this flawed assumption in more detail, let's turn to a definitive source on web security.
Examples of business logic vulnerabilities
The PortSwigger Web Security Academy has an excellent article on business logic examples. We will focus on the section that discusses how developer assumptions about user behavior can lead to vulnerabilities.
Please read the section titled "Making flawed assumptions about user behavior", and specifically the subsection "Users won't always follow the intended sequence". Focus on how an attacker can use tools to replay requests and perform interactions in any order they want, violating the application's expected state.
The key insight here is that if the application doesn't have robust server-side checks to verify that every preceding step has been successfully completed, it opens the door for a bypass. The server must act as a strict gatekeeper at every stage, not just assume you arrived there legitimately.
2. The Classic Example: Bypassing the Payment Step
The most famous and high-impact example of a workflow bypass is skipping the payment step in an e-commerce application. The intended flow is:
- Add items to cart.
- Provide shipping information.
- Enter payment details and pay.
- Be redirected to an order confirmation/success page.
The vulnerability occurs when the application doesn't verify that step 3 was actually successful before processing the order in step 4.
Let's watch a clear demonstration of this attack.
Business Logic Vulnerabilities | Complete Guide
In this section from Rana Khalil's "Business Logic Vulnerabilities" guide, she provides a perfect, concise example of bypassing an e-commerce payment flow.
Watch the video from 06:32 to 08:04. Notice how the attack works by simply navigating directly to the final step (delivery information) while completely skipping the intermediate payment step.
As you saw, the attacker adds items to their basket and then jumps directly to the delivery step, bypassing the payment. The backend logic, flawed in its assumption, processes the order for free.
To execute this, you would:
- Map out the entire checkout process, capturing each request in Burp Suite.
- Identify the URL for the final step (e.g.,
/order-confirmation?id=123). - After adding items to your cart, try to use Burp Repeater or your browser to navigate directly to that final URL.
The OWASP Web Security Testing Guide provides further guidance on how to systematically test for these "broken payment flows."
The OWASP WSTG offers a professional checklist for testing payment functionality. The section on breaking payment flows is particularly relevant to our learning outcome.
Read the section titled "Breaking Payment Flows". This provides several concrete ideas, including modifying shipping after billing and, most importantly, the force-browsing technique to access the success.php page directly.
3. Manipulating Workflows for Other Gains
Bypassing critical steps isn't limited to payment. This logic flaw can be found in any multi-stage process where maintaining a certain state is advantageous. Consider a discount mechanism:
- Add enough items to your cart to qualify for a "10% off" discount.
- The application applies the discount.
- Navigate back to the cart and remove the items that made you eligible for the discount.
- Proceed to checkout.
If the application fails to re-validate the discount eligibility when the cart changes, you get to keep the discount unfairly.
Rana Khalil's video also demonstrates this specific type of workflow manipulation.
Business Logic Vulnerabilities | Complete Guide
Let's watch another example from the same guide, this time focusing on how removing an item after a discount is applied can lead to a flaw.
Watch from 09:19 to 11:17. This example illustrates how the attacker violates the expected sequence by going backwards in the workflow to remove the qualifying item while retaining the discount.
This shows that workflow abuse isn't just about skipping forward; it can also involve moving backward or repeating steps to manipulate the application's state in your favor.
Test your understanding!
You are testing a website that offers online courses. To get a certificate, you must complete three steps in order:
- Enroll in a course (
/enroll?course_id=101). - Watch all video modules, which unlocks the exam (
/course/101/exam). - Pass the exam with a score of 80% or higher, which makes you eligible to claim a certificate (
/claim-certificate?course_id=101).
Using the principles of workflow bypass, describe two distinct tests you would perform to try and get the certificate without completing all the required steps.
Show answer
Here are two distinct workflow bypass tests:
-
Directly Access the Final Step (Forced Browsing):
- Action: First, enroll in the course to create a valid session and link your account to
course_id=101. Then, without watching any videos or taking the exam, directly try to browse to the final URL:/claim-certificate?course_id=101. - Goal: This tests if the backend of the
/claim-certificateendpoint validates that the "exam passed" status istruefor your user and course. If it only checks for enrollment, it might issue the certificate improperly.
- Action: First, enroll in the course to create a valid session and link your account to
-
State Manipulation via Parameter Tampering:
- Action: Go to the exam page (
/course/101/exam) and intentionally fail it. Then, find the request that submits your exam answers. It might look something likePOST /submit-examwith a body like{"course_id": 101, "answers": [...]}. The response might redirect you to a failure page like/exam-result?status=fail. Intercept this redirect response in Burp Suite and change it to/exam-result?status=pass, or try to directly access/claim-certificate?course_id=101immediately after submitting the exam, hoping the server state is not yet finalized. - Goal: This tests if the application state is managed on the client-side or if there's a window of opportunity to access the next step before the server fully processes the failure. It's a slightly different approach that tries to trick the application about the outcome of a step, rather than just skipping it.
- Action: Go to the exam page (
Conclusion
You have now explored a powerful technique for finding critical logic flaws. By refusing to follow the path laid out by the UI, you can uncover vulnerabilities that automated tools would almost certainly miss.
Key Takeaways:
- Workflow bypass vulnerabilities stem from the developer's flawed assumption that users will follow a predefined sequence of steps.
- Your primary tool is an interception proxy (like Burp Suite) to send requests out of order, skipping, repeating, or revisiting steps.
- The most common and impactful example is bypassing the payment step in e-commerce, but the principle applies to any multi-stage process.
- The core methodology is: Map the workflow, understand the developer's assumptions, and then systematically violate those assumptions.
Next Lesson Preview:
In this lesson, we manipulated the sequence of events. In our next lesson, we will introduce a new variable: time. We will explore race condition vulnerabilities, where you exploit minute delays in an application's processing by sending multiple requests almost simultaneously. This can allow you to do things like redeem a gift card multiple times before the server can update its balance.
