5. Exploiting server-side parameter pollution in a REST URL
Open the vulnerable application:

Lets navigate through the web application:


Forgot password:




Lets go to burpsuite:

Send it to the repeater and add # to it:

Lets try path traversal sequence on it:

It says invalid route so maybe this could refer to restful url path parameter pollution.
Lets find out:
I asked chatgpt, what is the name of the documented file for restful api:

Lets try openapi.json first:

Here we go we found the internal api, so username is a parameter, lets find if we can access field like the previous lab:
Here we go like the previous lab there is an email field as a value that we can access it:

And as the forgotPassword.js file in the burpsuite history, we have to find the PasswordResetToken to reset the administrator password:

Lets try get it:
It errors, and says that this version of the api only supports the email value to be parsed:


And as mentioned in a previous photo that the version is 2, lets try changing it to v1:
So we have to path traverse to get to the /internal to set the version to one:
And here we go, we got the token:

Lets go reset it using the path mentioned in the forgotPassword.js file:
And here we go:

After changing the password:


Lets navigate to the admin panel to delete the carols user to solve this lab:

And yup finally we solved the lab:

Solve it using a python3 script:
Last updated