Skip to content
Access control Write-up Intermediate

Breaking Business Logic — Part: 42–4= 2

The application authorised requests based on the name of the cookie holding the JWT rather than the token's contents. An attacker with a valid account for one organisation could rename their cookie to another organisation's token name and access that organisation's user data.

thehemdeep Follow

Published on thehemdeep.medium.com

Hello Hunters & Ninjas, Now I’m back with my new write-up, First of all request to accept my apology friends for this too late write-up, I’m writing this article probably after one and half year.

Hemdeep Gamit, on thehemdeep.medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the server used the cookie name to decide which organisation's data to serve, without validating that the JWT inside belonged to that organisation.

Impact

An authenticated user of one organisation could read another organisation's customer data, breaking tenant isolation.

What the attacker needed

A valid account for one organisation; knowledge of another organisation's token name

The fix

The application should validate the JWT's signature and its organisation claim against the requested organisation, not rely on the cookie name.

How it was found

  1. Log in as a user from one organisation and observe the GET request that fetches user data.
  2. Change the organisation name in the URL path to another organisation's name; the server returns 'Unauthorized'.
  3. Decode the JWT and change the organisation claim and algorithm to 'None', then resend; the server returns 'MODIFIED TOKEN'.
  4. Rename the cookie from the first organisation's token name to the second organisation's token name, leaving the JWT unchanged, and change the organisation in the URL.
  5. Send the request and successfully retrieve the other organisation's user data.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A JSON Web Token (JWT) is a signed piece of data that proves who you are. The application checked only the name of the cookie that carried the token, not the token itself. So by renaming their cookie, a user from one company could read another company's customer data.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.