⚗️Lab: Exploiting a mass assignment vulnerability
To solve the lab, find and exploit a mass assignment vulnerability to buy a Lightweight l33t Leather Jacket. You can log in to your own account using the following credentials: wiener:peter.
SOLUTIONS
METHOD ONE
Open Burp Suite
Login using username as wiener and password as peter
View the product to buy
Add it to the cart
Send the requests to the repeater
In the repeater send the
GET /api/checkoutrequest and view the output

Copy the chosen_discount parameter
In the repeater add the
chosen_discountparameter toPOST /api/checkoutand modify the as"parameter": 100Send the request

We bought the product for free.
METHOD TWO
In Burp's browser, log in to the application using the credentials
wiener:peter.Click on the Lightweight "l33t" Leather Jacket product and add it to your basket.
Go to your basket and click Place order. Notice that you don't have enough credit for the purchase.
In Proxy > HTTP history, notice both the
GETandPOSTAPI requests for/api/checkout.Notice that the response to the
GETrequest contains the same JSON structure as thePOSTrequest. Observe that the JSON structure in theGETresponse includes achosen_discountparameter, which is not present in thePOSTrequest.Right-click the
POST /api/checkoutrequest and select Send to Repeater.In Repeater, add the
chosen_discountparameter to the request. The JSON should look like the following:{ "chosen_discount":{ "percentage":0 }, "chosen_products":[ { "product_id":"1", "quantity":1 } ] }Send the request. Notice that adding the
chosen_discountparameter doesn't cause an error.Change the
chosen_discountvalue to the string"x", then send the request. Observe that this results in an error message as the parameter value isn't a number. This may indicate that the user input is being processed.Change the
chosen_discountpercentage to100, then send the request to solve the lab.
Last updated
Was this helpful?