How I Found an Exposed Google Maps API Key on a Global Brand’s Checkout Page
An unrestricted Google Maps API key was exposed in the server-rendered HTML of a checkout page. An attacker could use it to call the Places API, exhaust the free quota, incur billing charges, and learn the internal GCP project ID from error responses.
Bug bounty hunting is not always about chaining complex vulnerabilities for a critical RCE. Sometimes the most meaningful findings are sitting right there in the page source, quietly waiting for someone who knows what to look for.
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 Google Cloud API key was created without HTTP referrer or API scope restrictions, so it works from any origin and for any enabled API.
Impact
An attacker could exhaust the free quota and generate unexpected billing charges, and because the key has no API restrictions, any future enabled API would also be abusable; the GCP project ID is also exposed through error responses.
What the attacker needed
None
The fix
The key should be restricted with HTTP referrer and API scope restrictions, or replaced and routed through a backend proxy.
How it was found
- Browse to the checkout payment page and inspect the page source.
- Search the raw HTML for the Google API key pattern.
- Call the Places Nearby Search API with the key from an external machine without a referrer header.
- Observe a successful response with live data, confirming the key is unrestricted.
- Test other Google Maps APIs to map which ones are enabled.
- Note that disabled API error responses reveal the internal GCP project ID.
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 Google Maps API key is like a password that lets a website use Google's mapping services. If that key is visible in the page source and not locked down to specific websites or services, anyone can copy it and make requests on the owner's account, potentially costing them money.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.