CVE-2023-6777
Executive Summary
CVE-2023-6777 is a vulnerability in the WordPress plugin WP Go Maps (formerly WP Google Maps), affecting versions up to and including 9.0.34. The plugin exposes the developer's Google Maps API key in multiple plugin files, allowing any unauthenticated visitor to retrieve it. While this does not directly compromise the WordPress site itself, it enables attackers to use the stolen API key for their own purposes, potentially exhausting the key's request quota and causing a denial of service (DoS) for the map functionality on the affected site. The CVSS score is 5.3 (Medium), reflecting the low impact on confidentiality and availability, but the ease of exploitation (no authentication required) makes it a significant operational risk for site owners relying on Google Maps.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is specific to the WordPress plugin ecosystem. The WP Go Maps plugin is distributed via the official WordPress plugin repository. The exposure of the API key is a result of insecure coding practices within the plugin's source code, not a compromise of the WordPress package registry itself. Site administrators should verify the integrity of their plugin installation and consider manual remediation until an official patch is released.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) - Exploitable remotely.
- Attack Complexity (AC): Low (L) - No special conditions required.
- Privileges Required (PR): None (N) - No authentication needed.
- User Interaction (UI): None (N) - No user action required.
- Scope (S): Unchanged (U) - The vulnerability does not affect other components.
- Confidentiality (C): Low (L) - Only the API key is exposed, not sensitive user data.
- Integrity (I): None (N) - No data modification possible.
- Availability (A): Low (L) - Potential for API key exhaustion leading to map service denial.
Threat Level: Medium. The attack is trivial to execute, but the direct impact is limited to the availability of the map feature and potential financial cost from unauthorized API usage.
Deep Dive & Mechanics
The WP Go Maps plugin integrates Google Maps by requiring a Google Cloud API key. This key is typically stored in the plugin's settings and used in JavaScript to authenticate map requests. The vulnerability arises because the plugin embeds this API key directly into several server-side files (e.g., PHP files) that are accessible to unauthenticated users. An attacker can simply request these files or view the page source to extract the key.
The key is often found in:
- Plugin JavaScript files that are enqueued on the frontend.
- PHP files that output the key directly (e.g., in a
<script>tag). - AJAX endpoints that return the key without authentication checks.
Once obtained, the attacker can use the key to make requests to the Google Maps API, such as geocoding, directions, or static map generation. Google Cloud billing is tied to the key, so excessive usage can incur costs for the site owner. Additionally, if the key is not restricted by IP address or HTTP referrer, it can be used from any location.
Vulnerable vs. Patched Code
Vulnerable Code (Example from plugin file):
// In wp-google-maps/includes/class.map.php (or similar)
function enqueue_scripts() {
wp_enqueue_script('wp-google-maps-api', 'https://maps.googleapis.com/maps/api/js?key=' . get_option('wpgmza_google_maps_api_key'));
}
This code directly outputs the API key in the script URL, which is visible in the HTML source.
Patched Code (Hypothetical):
// In a patched version, the key should be server-side only and not exposed.
function enqueue_scripts() {
// Use a proxy endpoint or nonce to validate requests
wp_enqueue_script('wp-google-maps-api', admin_url('admin-ajax.php?action=wpgmza_get_maps_api_key'));
}
The patched version would require authentication (e.g., a nonce) to retrieve the key, or use a server-side proxy to make API calls without exposing the key to the client.
Exploitation & Lab Setup
Red Team (Exploitation)
- Identify Target: Use Shodan or Google dorking to find WordPress sites running WP Go Maps.
- Extract API Key: Visit the target site and view the page source. Search for
key=AIzaSy(Google API keys start withAIzaSy). Alternatively, directly request the plugin's JavaScript file:curl -s "https://target.com/wp-content/plugins/wp-google-maps/js/wp-google-maps.js" | grep -oP 'key=\K[^"&]+' - Validate Key: Use the key to make a test API call:
curl "https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway&key=AIzaSy..." - Abuse Key: Use the key for unauthorized map requests, potentially exhausting the quota.
Blue Team (Defense & Detection)
- Monitor API Key Usage: Set up Google Cloud alerts for unusual spikes in API requests.
- Restrict API Key: In the Google Cloud Console, restrict the key to specific HTTP referrers (e.g.,
*.yourdomain.com/*) and IP addresses. - Audit Plugin Files: Check for hardcoded keys in plugin files:
grep -r "AIzaSy" /path/to/wp-content/plugins/wp-google-maps/ - Implement WAF Rules: Block requests to plugin files that expose the key (e.g.,
wp-google-maps/js/*).
Indicators of Compromise (IOCs)
- File Paths:
/wp-content/plugins/wp-google-maps/js/wp-google-maps.js,/wp-content/plugins/wp-google-maps/includes/class.map.php - API Key Pattern:
AIzaSy[0-9A-Za-z_-]{33} - Network Traffic: Outbound requests to
maps.googleapis.comwith the stolen key from unexpected IPs. - Log Entries: Unusual 200 responses to plugin JS files from non-authenticated users.
Detection Engineering
YARA Rule
rule CVE_2023_6777_WP_Go_Maps_API_Key_Exposure {
meta:
description = "Detects exposure of Google Maps API key in WP Go Maps plugin files"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2023-6777"
strings:
$key_pattern = /AIzaSy[0-9A-Za-z_-]{33}/
$plugin_path = /wp-content\/plugins\/wp-google-maps/
condition:
$key_pattern and $plugin_path
}
Sigma Rule
title: CVE-2023-6777 WP Go Maps API Key Exposure
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects access to WP Go Maps plugin files that may expose Google Maps API key
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-uri-query|contains:
- '/wp-content/plugins/wp-google-maps/'
condition: selection
falsepositives:
- Legitimate plugin functionality
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2023-6777 WP Go Maps API Key Exposure"; flow:to_server,established; content:"/wp-content/plugins/wp-google-maps/"; http_uri; pcre:"/AIzaSy[0-9A-Za-z_-]{33}/R"; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Restrict the Google Maps API key in the Google Cloud Console to only allow requests from your domain (HTTP referrer restriction) and/or specific IP addresses.
- Plugin Update: Monitor the WP Go Maps plugin page for an official patch. If none is available, consider disabling the plugin or replacing it with an alternative.
- Manual Fix: Edit the plugin files to remove the direct key exposure. Use a server-side proxy or require authentication (e.g., a nonce) to retrieve the key.
- Key Rotation: Generate a new API key and update the plugin settings. Monitor the old key for abuse.
- WAF Rules: Block direct access to plugin JavaScript files that contain the key.
Report generated by Valters IT DevSecOps Intelligence.
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.