> For the complete documentation index, see [llms.txt](https://dev-angelist.gitbook.io/writeups-and-walkthroughs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev-angelist.gitbook.io/writeups-and-walkthroughs/portswigger-web-security-academy/information-disclosure/common-sources-of-information-disclosure/authentication-bypass-via-information-disclosure.md).

# Authentication bypass via information disclosure

## Description

This lab's administration interface has an authentication bypass vulnerability, but it is impractical to exploit without knowledge of a custom HTTP header used by the front-end.

To solve the lab, obtain the header name then use it to bypass the lab's authentication. Access the admin interface and delete the user `carlos`.

You can log in to your own account using the following credentials: `wiener:peter`

## Solution

<figure><img src="/files/u5OyD0zZQsoit6d31XNe" alt=""><figcaption></figcaption></figure>

Starting access to wiener user <https://0ae80062039d9b5194f2429800130047.web-security-academy.net/login>

Checking page sources there're not of interesting, so we can try access to admin page adding /admin path to our URL: <https://0a160012030fde108045dab900300013.web-security-academy.net/admin>

and we can see this information disclosure message: "Admin interface only available to local users"

<figure><img src="/files/DBi4BwQZQMH47KvtGgZb" alt=""><figcaption></figcaption></figure>

so, we start to analyze request for understanding more things

<figure><img src="/files/twURCO0k9CCDA8jeHFVU" alt=""><figcaption></figcaption></figure>

We can try to change request method to see if the answer changes.

It will happen via TRACE method with the response status code 200.

<figure><img src="/files/ukqv8iuNBQ2MtmF1d68v" alt=""><figcaption></figcaption></figure>

Trace is a debug method and it display us an important information as: X-Custom-IP-Authorization: 37.101.171.137

We can copy it inserting a localhost IP: 127.0.0.1 in our request and change again method to GET

<figure><img src="/files/Rt07kEtVUQQvTAxqz2Y7" alt=""><figcaption></figcaption></figure>

Now we're into admin panel having the permission to delete 'carlos' user

<figure><img src="/files/IwceG2AcaSbhB9FfNxtV" alt=""><figcaption></figcaption></figure>

analyzing the reponse, there's a URL that permits to delete 'carlos' account: `GET /admin/delete?username=carlos`

<figure><img src="/files/JBgXoh1SBm9iU8ZSEjnW" alt=""><figcaption></figcaption></figure>

Copy and add it into our request to delete account and solve the lab.

<figure><img src="/files/sC32YuWlBZLnQ9MC12cA" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/3uI6Bw6Z3WZTVfEQ5ghw" alt=""><figcaption></figcaption></figure>
