Predict a potential collision
-
Log in and purchase a gift card so you can study the purchasing flow.
-
Consider that the shopping cart mechanism and, in particular, the restrictions that determine what you are allowed to order, are worth trying to bypass.
-
From the proxy history, identify all endpoints that enable you to interact with the cart. For example, a
POST /cartrequest adds items to the cart and aPOST /cart/checkoutrequest submits your order. -
Add another gift card to your cart, then send the
GET /cartrequest to Burp Repeater. -
In Repeater, try sending the
GET /cartrequest both with and without your session cookie. Confirm that without the session cookie, you can only access an empty cart. From this, you can infer that:- The state of the cart is stored server-side in your session.
- Any operations on the cart are keyed on your session ID or the associated user ID.
This indicates that there is potential for a collision.
-
Notice that submitting and receiving confirmation of a successful order takes place over a single request/response cycle.
-
Consider that there may be a race window between when your order is validated and when it is confirmed. This could enable you to add more items to the order after the server checks whether you have enough store credit.
Benchmark the behavior
-
Send both the
POST /cartandPOST /cart/checkoutrequest to Burp Repeater. -
In Repeater, add the two tabs to a new group. For details on how to do this, see Creating a new tab group
-
Send the two requests in sequence over a single connection a few times. Notice from the response times that the first request consistently takes significantly longer than the second one. For details on how to do this, see Sending requests in sequence.
-
Add a
GETrequest for the homepage to the start of your tab group. -
Send all three requests in sequence over a single connection. Observe that the first request still takes longer, but by "warming" the connection in this way, the second and third requests are now completed within a much smaller window.
-
Deduce that this delay is caused by the back-end network architecture rather than the respective processing time of the each endpoint. Therefore, it is not likely to interfere with your attack.
-
Remove the
GETrequest for the homepage from your tab group. -
Make sure you have a single gift card in your cart.
-
In Repeater, modify the
POST /cartrequest in your tab group so that theproductIdparameter is set to1, that is, the ID of the Lightweight L33t Leather Jacket. -
Send the requests in sequence again.
-
Observe that the order is rejected due to insufficient funds, as you would expect.
Prove the concept
-
Remove the jacket from your cart and add another gift card.
-
In Repeater, try sending the requests again, but this time in parallel. For details on how to do this, see Sending requests in parallel.
-
Look at the response to the
POST /cart/checkoutrequest:- If you received the same "insufficient funds" response, remove the jacket from your cart and repeat the attack. This may take several attempts.
- If you received a 200 response, check whether you successfully purchased the leather jacket. If so, the lab is solved.