gmaps-mcp Unauthenticated HTTP Transport Allows Unlimited Google Maps API Calls
The gmaps-mcp package allows unauthenticated access to Google Maps API calls when deployed with a blank MCP_API_KEY, potentially leading to significant financial costs for the operator; it also permits path injection attacks.
The gmaps-mcp package (version 0.1.2 and earlier) is vulnerable to a critical flaw that allows unauthenticated attackers to make unlimited Google Maps API calls at the operator’s expense. This occurs because the HTTP transport in server.py does not enforce authentication when the MCP_API_KEY environment variable is not set, which is the default configuration. As a result, any attacker who knows the server’s URL can invoke the API and generate billed requests. The default configuration, as detailed in the README, instructs operators to expose the server via ngrok, making it accessible over the internet. Additionally, the place_id parameter in client.py is vulnerable to path injection, enabling attackers to manipulate the Places API endpoint. A Claude skill file is shipped with the package, creating a potential injection surface.
Attack Chain
- Operator deploys
gmaps-mcpwith the default configuration, including a blankMCP_API_KEYand exposes the server using ngrok per README instructions. - Attacker discovers the ngrok URL through public endpoint scans or targeted probes.
- Attacker sends a POST request to the
/mcp/endpoint without anX-API-Keyheader, invoking a Google Maps API tool. - The
server.pycode at lines 186-192 bypasses authentication checks becauseMCP_API_KEYis unset. - The request is forwarded to the Google Maps API, utilizing the operator’s
GOOGLE_MAPS_API_KEY. - The Google Maps API processes the request and returns the result to the attacker.
- The operator’s Google Cloud Platform (GCP) account is charged for the API usage.
- Attacker repeats the process to exhaust the operator’s free credit or generate significant charges.
Impact
Successful exploitation of this vulnerability can result in significant financial losses for the operator due to unauthorized Google Maps API usage. An attacker can quickly exhaust the $200/month free credit, potentially leading to substantial charges. The Places API pricing is roughly $17 per 1,000 requests, and a sustained 1 request/second flood can exhaust the credit in approximately 3 hours. Furthermore, the path injection vulnerability in the place_id parameter allows attackers to manipulate the Places API endpoint, potentially forcing higher-cost API calls.
Recommendation
- Implement the suggested fix by adding a startup check in
server.pyorrun.pythat exits ifMCP_API_KEYis unset when using HTTP transport, preventing unauthenticated access (seeserver.pylines 186-192). - Update the
.env.examplefile to clearly indicate that settingMCP_API_KEYis required for HTTP transport (see.env.example). - Add a warning to the README file before the ngrok instructions, emphasizing the importance of setting
MCP_API_KEYto prevent unauthorized API calls (see README). - Deploy the Sigma rule
Detect gmaps-mcp Place ID Injection Attemptto identify potential path injection attacks via theplace_idparameter.
Detection coverage 2
Detect gmaps-mcp Place ID Injection Attempt
highDetects attempts to inject malicious payloads into the place_id parameter when calling the gmaps-mcp API, potentially leading to path injection and unauthorized access to other Google Maps API endpoints.
Detect gmaps-mcp Unauthenticated API Access Attempt
mediumDetects POST requests to the gmaps-mcp API endpoint without a valid X-API-Key header, indicating a potential attempt to exploit the unauthenticated access vulnerability.
Detection queries are available on the platform. Get full rules →
Indicators of compromise
1
url
| Type | Value |
|---|---|
| url | http://<server>:8000/mcp/ |