Skip to content
Access control Write-up Intermediate

How I Could've Accessed 17 Trillion Microsoft Records

An internal Microsoft analytics service accepted unsigned JSON Web Tokens and used the token's user principal name claim as a local username, so an attacker could claim the administrator identity and run SQL queries without credentials. This gave access to metadata and bounded samples across many analytics databases, with a hypothetical reach of about 17.3 trillion stored rows.

blog.faav.net

Published on blog.faav.net

Two quick notes first. The impact I describe is hypothetical.

The author, on blog.faav.net

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

The service validated the token's claims but did not verify its cryptographic signature, and it treated the user principal name claim as a local username.

Impact

An attacker could run SQL as an administrator against many analytics databases, reaching metadata and bounded samples; the 17.3 trillion row figure is a storage estimate and the full data impact is hypothetical.

What the attacker needed

Network access to the API; knowledge of expected token claim values; a table routing value

The fix

The API endpoint was locked down after the report.

How it was found

  1. Find the internal API and its Swagger file listing the query route.
  2. Recover archived configuration to get table routing values.
  3. Send a query with no authorization header and receive a 401.
  4. Craft an unsigned token with the expected tenant, audience and application values.
  5. Change the user principal name claim to admin and run a SQL query successfully.

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 is a small signed piece of data a service uses to prove who you are. This service checked the details inside the token but never checked the signature, so anyone could write their own token and pretend to be an administrator. That let the researcher run database queries without a real login.

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.