Skip to content
Misconfiguration Write-up Beginner

The Unrestricted Key: How I Bypassed Microsoft’s API Controls

An exposed Google Cloud reCAPTCHA Enterprise API key was found in a JavaScript file on a Microsoft domain. The key lacked HTTP Referer restrictions, allowing an attacker to use it from any domain, bypassing intended access controls.

blog.leetsec.in

Published on blog.leetsec.in

In the bug bounty world, we often chase the “critical” bugs like Remote Code Execution (RCE) or SQL Injection. But sometimes, simple architectural anomalies teach you the biggest lessons.

Aman Kumar (ak), on blog.leetsec.in

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 reCAPTCHA key was created without HTTP Referer restrictions, allowing requests from any domain.

Impact

An attacker could use the unrestricted key from any domain, potentially consuming Microsoft's reCAPTCHA quota or abusing the service, though the text does not specify further impact.

What the attacker needed

Knowledge of the target domain; ability to send HTTP requests

The fix

The issue was fixed by Microsoft within 20 days, likely by adding HTTP Referer restrictions to the key.

How it was found

  1. Use Jsmon to scan JavaScript files on microsoft.com for hardcoded secrets.
  2. Identify a Google Cloud API key in a JavaScript file.
  3. Craft a curl request to the reCAPTCHA Enterprise API with a spoofed Referer header pointing to attacker.com.
  4. Observe that the API returns HTTP 200 OK, confirming the key is active and unrestricted.

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 reCAPTCHA key is like a password that lets a website use Google's spam protection. Normally, it should only work from the website's own pages. Here, the key had no such restriction, so anyone could use it from their own site, potentially abusing Microsoft's quota or services.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.