example.com
A publicly accessable Google Maps API key was discovered in the response body of [example.com]. The key is not properly restricted and can be abused by an attacker to generate unauthorized Google Cloud Platform (GCP) charges by making billable API calls.
example.com
The key is present directly in the HTTP response body when visiting the subdomain.
curl -s example.com | grep -o "AIza[0-9A-Za-z_-]\{35\}"
This should print the exposed API key to the screen. It will look somthing like this: AIzaSyD***********************nOpw
https://maps.googleapis.com/maps/api/geocode/json?latlng=40,30&key=AIzaSyD***********************nOpw
The leaked key was tested and confirmed to have no restrictions against high-cost Google Maps services. The following request demonstrates that an attacker can make billable calls:
https://maps.googleapis.com/maps/api/geocode/json?latlng=40,30&key=AIzaSyD***********************nOpw
When Google Maps API keys are publicly exposed and not properly restricted, they can be exploited by attackers to make high-volume requests to premium APIs. This leads to:
Restrict Google Maps API keys in the Google Cloud Console by: