> For the complete documentation index, see [llms.txt](https://notes.dollarboysushil.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.dollarboysushil.com/web-application-pentest/bugforge/broken-access-control/tanuki.md). Agents can also search and read this documentation through its [MCP server](https://notes.dollarboysushil.com/~gitbook/mcp).

# Tanuki

Level: Easy\
Points: 10\
Type: Daily Challenge

Lab Interface

<figure><img src="https://559802299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8C3FiojCIEtxH7nox2Do%2Fuploads%2FgueFLCWtQnqbmqtwopiX%2Fimage.png?alt=media&amp;token=1370e97e-918e-44e2-9df6-a8b535084cdb" alt=""><figcaption></figcaption></figure>

In `/profile` we have optiont to edit our profile

<figure><img src="https://559802299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8C3FiojCIEtxH7nox2Do%2Fuploads%2FGeFyJB0QAyNbHcTJlQ3Z%2Fimage.png?alt=media&amp;token=6dc9db16-3e21-4310-875e-e3fdac0e95fe" alt=""><figcaption></figcaption></figure>

request to update profile

<figure><img src="https://559802299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8C3FiojCIEtxH7nox2Do%2Fuploads%2FVVrLtDooAIX5gpshGsbX%2Fimage.png?alt=media&amp;token=3a066ec9-f317-43f4-91f5-e4f27324393e" alt=""><figcaption></figcaption></figure>

with this request, the first thing that comes in mind is if we can edit the profile of other user\
so, to test this, i created new account `test@gmail.com`

<figure><img src="https://559802299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8C3FiojCIEtxH7nox2Do%2Fuploads%2FJtBrYVW6YuO7wMGFkYCP%2Fimage.png?alt=media&amp;token=51e7ae4c-e0db-43f7-a7f0-cb791bb6c39e" alt=""><figcaption></figcaption></figure>

then I tried to edit the email and password of `test@gmail.com` and got error `Email already exists or invalid data`

<figure><img src="https://559802299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8C3FiojCIEtxH7nox2Do%2Fuploads%2FEsbJ8vjAf7HeN2LVuhnr%2Fimage.png?alt=media&amp;token=8584eaaf-207e-4e80-b641-ebccf982e1a8" alt=""><figcaption></figcaption></figure>

Key thing is username is passed in the request `/api/profile/{username}`

so, I tried editing the username and it worked

<figure><img src="https://559802299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8C3FiojCIEtxH7nox2Do%2Fuploads%2FFFo7bLsIGaAGRzqwekQs%2Fimage.png?alt=media&amp;token=b0c6dbaa-dfd1-425b-9a74-c20a96ab4334" alt=""><figcaption></figcaption></figure>

There is no ownership check on `/api/profile/{usernname}`, meaning anyone with a valid token can edit the details of anyother account.
