Skip to content
Leaked secrets Write-up Intermediate

Vulnerable Directory + Broken Token Generator = Authorizing Every

A publicly accessible JavaScript configuration file exposed client credentials, which the author used to obtain a valid OAuth access token. That token then bypassed 401 responses on API endpoints, enabling easier reconnaissance.

nnface Follow

Published on medium.com

Oh, Is this another big company with a Fatal Bug inside? Required are only basic knowledge and combinatorism to find a bug?

NnFace, 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 a publicly reachable JavaScript configuration file exposed OAuth client credentials, and the token endpoint accepted them for the client credentials grant.

Impact

An attacker could obtain valid tokens without logging in and use them to access API endpoints that were meant to be protected, making reconnaissance easier; the text does not show access to sensitive user data.

What the attacker needed

Publicly accessible config.js file; valid client credentials in that file; token endpoint reachable

The fix

The exposed configuration file should be removed from public access and the leaked client credentials rotated.

How it was found

  1. Enumerate subdomains and crawl for directories and JavaScript files.
  2. Find a publicly accessible config.js file containing identifiers and secrets.
  3. Send a token request to the OpenID Connect token endpoint using the discovered client credentials.
  4. Receive a valid access token and ID token.
  5. Use the token in an Authorization header to access API endpoints that otherwise returned 401.

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 website left a configuration file readable by anyone, and that file contained a username and password for a login service. The author used those to get a valid pass, then showed that the pass opened API pages that normally say 'not allowed'.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

More by nnface

View all

4 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.