portswigger-all-labs

Complete PortSwigger Web Security Academy Lab Writeups Detailed, categorized solutions for every lab — from APPRENTICE to EXPERT — covering all 30 vulnerability types.

View on GitHub

Lab Covered

This write-up focuses on the following APPRENTICE-level lab from the PortSwigger Web Security Academy:

1 Exploiting an API endpoint using documentation

This lab demonstrates how attackers can take advantage of publicly available API documentation to uncover and exploit sensitive endpoints. It emphasizes the importance of not exposing functionality that should remain private.

LAB 1 - Exploiting an API endpoint using documentation

Lab Description :

image

Solution :

Login as Wiener with the provided credentials - wiener:peter.

image

Now when we change the email of wiener, the browser sends the folowing PATCH request to /api/user/wiener

image

So we remove wiener form request to see what will happen and we can see below it is giving us Malformed url error

image

If we remove user/wiener and send the request, the server responds with a 302 redirect. Following the redirect leads us to the REST API documentation.

image

Now we can delete the user carlos by sending a DELETE request to /api/user/carlos.

image

Now we have deleted carlos’s account & thus solved the lab.

image