Skip to content
On this page

User ID controlled by request parameter with password disclosure (🇬🇧ENG | 🇵🇱PL) ​

Link: https://portswigger.net/web-security/access-control/lab-user-id-controlled-by-request-parameter-with-password-disclosure

description

After clicking "Access the lab", we see a store:

shop main page

We click "My Account" and log in with the username and password that we saw in the task description, namely:

wiener:peter

logging

Here we can notice two interesting things. First: there is a place with a saved password, and second: the username is visible in the URL.

after logging

Let's see what happens if we change "wiener" to "administrator".

changing wiener to admin

After the change and hitting "Enter", we see that the password length has changed.

We can right-click on this field, select "Inspect" and check what interesting things we find in the code:

inspect element

The password appears in the code, which we can copy:

password in HTML code

The goal of the task is to log in as an administrator and delete the user carlos, so we log out, enter our username, which is "administrator", and the password, which in this case is: "2mjl02cmn2pvzs2gkvf1". Passwords will differ in each task, so it's not worth copying. 😃

after admin logging

We see the "Admin panel", so we go there and delete the user:

poor carlos

carlos deleted

This is another example of an incorrect way of creating applications. Passwords used in applications should not be stored "on the front", or stored in plain text.


🇵🇱PL:

Link: https://portswigger.net/web-security/access-control/lab-user-id-controlled-by-request-parameter-with-password-disclosure

description

Po kliknięciu "Access the lab", widzimy sklep:

shop main page

Klikamy "My Account" i logujemy się loginem i hasłem, które widzieliśmy w opisie zadania, czyli

wiener:peter

logging

Można zauważyć tutaj dwie ciekawe rzeczy. Pierwsza: jest miejsce z zapisanym hasłem, oraz druga: w adresie URL widoczna jest nazwa użytkownika.

after logging

Sprawdźmy co się stanie, jeśli zmienimy "wiener" na "administrator".

changing wiener to admin

Po zmianie i kliknięciu "Enter", widzimy, że długość hasła zmieniła się.

Możemy kliknąć na tym polu prawym przyciskiem myszy, wybrać "Inspect" i sprawdzić co też ciekawego znajdziemy w kodzie:

inspect element

W kodzie widnieje hasło, które możemy skopiować:

password in HTML code

Celem zadania jest zalogowanie się jako administrator i usunięcie użytkownika carlos, zatem wylogowujemy się, wpisujemy nasz login, czyli "administrator", oraz hasło, czyli w tym przypadku: "2mjl02cmn2pvzs2gkvf1". Hasła będą się różnić w każdym jednym zadaniu, także tego nie warto kopiować. 😃

after admin logging

Widzimy "Admin panel", zatem przechodzimy tam i usuwamy użytkownika:

poor carlos

carlos deleted

To kolejny przykład niepoprawnego sposobu tworzenia aplikacji. Hasła, które są używane w aplikacji nie powinny być przechowywane "na froncie", czy też przechowywane jawnym tekstem.