How I Was Able To Find And Exploit The Google Maps Api Key Of A Target And You Can Do It Too
A Google Maps API key was exposed in the source code of an admin login page. The key was restricted for the Static Map endpoint but worked on other endpoints, allowing unauthorised calls that could incur costs or cause denial of service.
Published on infosecwriteups.com
Hey, What’s Up Fellow Hackers & pro bug bounty huntershope you are doing well and staying safe, hunting heavily and bunking online classes( Everyone Does xD). So today I am going to share an interesting story about one of my interesting finding in a program.
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 API key was not properly restricted to specific endpoints or referrers, allowing it to be used on most Google Maps API endpoints.
Impact
An attacker could make unauthorised API calls, potentially causing financial damage or a denial of service if quotas are exhausted.
What the attacker needed
Publicly accessible web page with source code; Google Maps API key exposed in source
How it was found
- Enumerate subdomains and probe for live hosts.
- Visit each live subdomain manually and inspect the source code.
- Find a Google Maps API key in the source code of an admin login page.
- Test the key on various Google Maps API endpoints using a reference like Keyhacks.
- Observe that the key works on all endpoints except the Static Map endpoint.
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.
An API key is like a password that lets a website use a service, such as Google Maps. If the key is left in the page's code, anyone can copy it and use the service on the company's account, which can cost money or use up their allowed usage.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.