Skip to content
Access control Write-up Beginner

Overly Permissive Azure SAS Token

An API endpoint returned a container-scoped Azure SAS token with read, write, delete and list permissions to any authenticated user, including self-registered accounts. An attacker could use it to enumerate, download, overwrite or delete every document in a healthcare blob container holding PHI and PII.

medium.com

Published on medium.com

A single API call handed every registered user a Read/Write/Delete/List SAS token for an entire healthcare document container. Here’s my write-up on how I discovered this critical vulnerability during a recent penetration testing engagement.

r0h1th, on 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 three design failures combined: no authorization check on who can request a SAS token, the token was scoped to the whole container instead of a single blob, and it granted read, write, delete and list permissions instead of read-only.

Impact

Any authenticated user could enumerate, download, overwrite or permanently destroy every document in the container, exposing PHI and PII of all applicants; the text does not mention any defence that limited the exploit.

What the attacker needed

A free self-registered account; valid session token

The fix

The endpoint should authorize the requesting user for the specific blob, issue a read-only SAS scoped to that single blob with a short expiry, and prefer Azure AD user-delegation SAS over account-key SAS.

How it was found

  1. Send a GET request to the SAS token endpoint with a normal user's bearer token.
  2. Use the returned SAS token to list all blobs in the container directly against Azure Blob Storage.
  3. Download any blob from the listing to read applicant records.
  4. Upload a marker blob to confirm write access, then delete it to confirm delete access.

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 SAS token is like a temporary key that lets someone access files in cloud storage without logging in again. Here the server gave every logged-in user a key that opened the whole storage container, not just their own file, and allowed reading, writing and deleting. That meant any ordinary user could see or destroy other people's private medical documents.

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.